Skip to main content

How to Make a Simple Reddit to Twitter Bot (Python) Part 1

So why make a Reddit to Twitter bot? I don't know. I made it because it's a fun project that can be made as simple or as complex as you want. I also like to get all my soccer (football) news in one place, and r/soccer is usually the fastest aggregator of breaking news.

In this tutorial, we will write a python script that posts the top 10 hourly soccer posts on twitter. I am going to show you how to get your bot up and running quickly, so I will skip a lot of details.

Prerequisites: basic python knowledge

Getting Reddit API Access

1.  Go to https://www.reddit.com/prefs/apps/
2.  Click on create app.

                                     
3.  Name it whatever you like. Choose scripts as type and set local host (http://127.0.0.1) as your redirect url. 

4. Note down the personal use scripts code, and the secret code. Keep it in a secure place. 


5.  Install Praw -pip install praw on cmd
6. Go to Python37\Lib\site-packages\praw\praw.ini and add the codes that you noted down in step 4. create [bot1] if you cannot find it. user_agent = PyEng Bot 0.1



Getting Twitter API Access

1. Go to https://developer.twitter.com/en/apps

2. Click on create App, follow instructions and fill in all the fields. Use localhost for callback url.

3. Wait for 1-2 days until you get developer access and come back for part 2 of this series.






Comments

Popular posts from this blog

Wire Insulation Quality Control

For my Capstone Project with Encore Wire Corp, I designed and prototyped this semi-automated machine in cooperation with a team of five other engineering students. The  wire insulation measurement apparatus involves a mechanical thickness measuring solution using four needle penetrometers (linear actuators with linear variable differential transformer attachments) and a load cell for mass measurements. A 12-inch sample is inserted into the apparatus and thickness measurements are taken at 2” intervals along the length of the wire before it is scored and massed. The apparatus GUI then provides the operator with the thickness, alignment, and mass measurements to be included in quality control forms. The wire insulation measurement apparatus consists of a penetrometer plate consisting of four needle penetrometer units, two roller system units, a cutting mechanism, and a load cell basket encased in an 8020-Aluminum frame and polycarbonate external structure. The apparatu...