Editing
Reddit Bots
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== OAuth2 == === Register an app on Reddit === * Log in as the user who will be the owner of the app. * [https://www.reddit.com/prefs/apps] * Click '''Create Another App...''' ** Fill out the form. ** Select '''personal use script''' if this app will run locally. This can't be changed later and the authentication is different for each kind of app, so a web app's credentials can't be used in a script app context. ** Click '''Save App''' to generate a Client Id and Client Secret for the app. The Client Id is displayed in the list of apps. The secret can be retrieved by clicking the '''Edit''' link by the app in the listings. == PRAW == The python [https://praw.readthedocs.io/en/stable/ `praw`] library that is a wrapper for the [https://www.reddit.com/dev/api/ Reddit API]. == Obscuring IP address == Bot through proxy instead of VPN. <ref>[https://www.reddit.com/r/shoebots/comments/dsjwaz/guys_why_should_i_bot_through_a_proxy_instead_of/ Guys why should I bot through a proxy instead of using a VPN?]</ref> * Proxies are faster than VPNs. * A VPN is a single connection, so still a single IP. * Proxies allow multiple connections at once, so many IPs. === Acquiring proxies === Things to look up: residential vs private proxies. Don't know if this site is legit or not but there is info here: [https://www.bestproxyreviews.com/reddit-proxies/ Best Reddit Proxies of 2022] - Best Proxy Reviews Some suggestions to follow up on: * [https://proxy.webshare.io https://proxy.webshare.io] - random reddit user recommends them for price * [https://smartproxy.com https://smartproxy.com] - residential proxies * [https://myprivateproxy.net https://myprivateproxy.net] - private proxies === Setting proxy in python === Proxy is determined by the `http_proxy` and `https_proxy` OS environment variable. <syntaxhighlight lang="python"> import os proxy = 'http://<user>:<pass>@<proxy>:<port>' os.environ['http_proxy'] = proxy os.environ['HTTP_PROXY'] = proxy os.environ['https_proxy'] = proxy os.environ['HTTPS_PROXY'] = proxy </syntaxhighlight> == See also == === External links === * [https://www.reddit.com/dev/api/ Reddit API] - Reddit documentation * [https://praw.readthedocs.io/en/stable/ PRAW library] - The Python Reddit API Wrapper * [https://yojji.io/blog/how-to-make-a-reddit-bot How to Make a Reddit Bot] - Yojji.io Blog === References === <references />
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information