Coder Social home page Coder Social logo

reddit's Introduction

reddit

A collection of reddit bots and utilities, all written by /u/GoldenSights. Many of these are done via /r/botrequests+requestabot, and some are done on a whim.


###Before running any of my bots

Read this.

Do not put multiple programs in the same folder. They use SQL databases to store information and you musn't allow them to mix. You can always edit sql = sqlite3.connect('sql.db') to use a different filename for the database, but folders are nice.

Use descriptive useragents. Include a username by which admins can identify you. Tell what your bot is doing and why. Convince the admins that you aren't wasting their bandwidth. Inadequate useragents may cause your bot to get logged out in the middle of your session, and the program will crash. Abusive useragents can get your bot shadowbanned.

Reddit API rules


###Concerned about your password?

For the bots that require login information, I tell you to put your password in the Config area as PASSWORD. Understandably, you may be concerned about having your password stored in plain text on your computer.

If you replace

PASSWORD = ""

with

PASSWORD = input("Password: ")

Then you will be asked to type in your bot's password when it starts. For additional security, you can put

del PASSWORD

immediately after r.login() so that the password variable is nowhere in the namespace. If you want your password to be hidden while typing, use the getpass module instead of the standard input.

Alternatively, for automated and semi-secure password storage, see Bot.py


###Bot.py

In a lot of my bots, you'll see

import bot

USERNAME = bot.uG

etc. This is a file in my python library which contains my username and my password. I use this system so that I can push this code to git without worrying about my password being seen.

To create your own bot.py is very simple. It's just a regular .py file which you save in C:\Python34\Lib. Then you just enter some variables

username = "GoldenSights"

password = "12345"

Then, when you import bot, you can type bot.username and get "GoldenSights". You can create as many variables as you want, including useragents and multiple account credentials.

reddit's People

Contributors

voussoir avatar bboe avatar damgaard avatar tmelz avatar julian avatar nemec avatar deimos avatar hazimgazov avatar rasher avatar jensechu avatar tailszefox avatar anlsh avatar tomdunn avatar shalecraig avatar jknabl avatar dahlia avatar foxx avatar aaronhall avatar chizu avatar paul-nechifor avatar renfredxh avatar fluxflashor avatar shrayasr avatar simongreenhill avatar pinkerton avatar sente avatar billywm avatar wiwiweb avatar epsy avatar binaryechoes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.