Reddit Bots: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "== 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 === TK == See also == === External links === * [https://yojji.io/bl...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
== 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 ==
== Obscuring IP address ==


Line 9: Line 26:
=== Acquiring proxies ===
=== Acquiring proxies ===


TK
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 ==
== See also ==
=== External links ===
=== 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
* [https://yojji.io/blog/how-to-make-a-reddit-bot How to Make a Reddit Bot] - Yojji.io Blog
=== References ===
=== References ===
<references />
<references />

Latest revision as of 14:42, 30 April 2022

OAuth2[edit]

Register an app on Reddit[edit]

  • Log in as the user who will be the owner of the app.
  • [1]
  • 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[edit]

The python praw library that is a wrapper for the Reddit API.

Obscuring IP address[edit]

Bot through proxy instead of VPN. [1]

  • 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[edit]

Things to look up: residential vs private proxies.

Don't know if this site is legit or not but there is info here: Best Reddit Proxies of 2022 - Best Proxy Reviews

Some suggestions to follow up on:

Setting proxy in python[edit]

Proxy is determined by the http_proxy and https_proxy OS environment variable.

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

See also[edit]

External links[edit]

References[edit]