Creating a simple Reddit Bot!

Objective:

Technologies used:

Process:

ls -d */ | sed 's#/##
for directory in $allDirectories ; doecho $directorydone
if grep -Fxq "$directory" posts.txt
then
continue
else
echo "$d" >> posts.txt
fi
curl -X POST -d 'grant_type=password&username=username&password=password' --user 'clientId:clientSecret' 
https://www.reddit.com/api/v1/access_token --user-agent "name of your bot 1.0"
curl -X POST -d 'grant_type=password&username=username&password=password' --user 'clientId:clientSecret' 
https://www.reddit.com/api/v1/access_token --user-agent "name of your bot 1.0" > credentials
sed -i 's/,.*$//' credentials
sed -i 's/{"access_token": "//' credentials
sed -i 's/.$//' credentials
token=$(<credentials)
curl -H "Authorization: bearer $token" -A "name of your bot 1.0" https://oauth.reddit.com/api/submit 
-d "api_type=json&extension=json&sendreplies=true&
resubmit=true&kind=link&sr=NameOfYourSubreddit&title=$directory&url=http://YourWebsite.com"

--

--

--

Learning, and posting my findings!

Love podcasts or audiobooks? Learn on the go with our new app.

How to Take Charge of Your Company’s Automation Success: Becoming a Citizen Developer

tinyhabits: “Complete!”

How to get started with CloudFormation templates

My 100daysOfCode Journal — Day 01

🚀Summary of the first APYS/DSCPL LP program epoch!

Hands-on guide to Computer vision (CV) on Edge -AWS Panorama

At the beginning of 2019, I was celebrating 11 years of being with Greico Financial Training.

Nuts and Bolts of datetime module in Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matthew Boyd

Matthew Boyd

Learning, and posting my findings!

More from Medium

Mirai Source Code — Overview

Destroying files using Google Chrome

CUDA Support for Hashcat on Parrot OS

Install Zabbix Agent and Add Dashboard with PSK