Sheddit
Sheddit copied to clipboard
๐A Go program to schedule posts for reddit.
โฑSheddit
ShedditUI
ShedditUI is a desktop application for Sheddit. So if you don't want to interact with a server directly then you can use ShedditUI. It has been released for macOS and Windows. It's also free and open source.
NOTE: Sheddit UI is a mere desktop application, it still needs Sheddit server to function. So the below setup is required regardless.
Setup
There are a few configurations that need to be done.
NOTE: this is a script type app for reddit, so it has access only to developer's account, you can add more accounts from reddit app creation board
Get keys for reddit
- Go to reddit's app creation page
- Create an app, remember to select script from the radio button menu.
- Note down client secret and client id (both will appear in the app details once it is created)
Get keys for twitter
- Go to Twitter Developer Account and apply for a developer account.
- Fill in the application. Verify your email address by clicking on the link sent in verification mail by twitter (after you complete application).
- After successful verification go to create application dashboard and click on create app.
- Fill in the application and hit create. (Filling only the required fields will suffice)
- Upon completion, click on Keys and tokens tab and note down API key, API secret key, access token and access token secret. (Generate access token and access token secret if not already generated.)
Creating a env file
(If you are using ShedditUI it .env file be generated by clicking on the first icon in the top right corner.)
-
Create .env file in the root of this projects directory (sample env file below) Sample .env file looks like this
clientid=your-client-id-goes-here clientsecret=your-client-secret-goes-here useragent=sample-useragent username=your-reddit-username password=your-reddit-password auth_url=www.reddit.com secure_api=https://oauth.reddit.com/api t_consumerkey=twitter-api-key t_consumersecret=twitter-api-secret t_accesstoken=twitter-access-token t_accessecret=twitter-access-secret bucketname=any-string-is-fine postgres_url=url-to-postgres-db smtp_server=smtp-sever-address smtp_port=smtp-port smtp_username=smtp-userame smtp_password=smtp-password smtp_sender=smtp-sender-email-address
Running the server
- Run the program with the command
godotenv -f .env go run main.go
Supported endpoints
โพ schedulePost
Schedule a post for either twitter or reddit.
Example data for request:
"subreddits":"test", (In case multiple, comma seperate them)
"title":"title-of-your-post",
"text":"Body of your post"
"link":"any-validurl",
"scheduledate":"2020-03-06T10:46:00.000Z" (ISO DatetimeString)
"provider":"twitter"||"reddit"
Things to remember
-
When the provider is twitter
- Text corresponds to the tweet text
-
When the provider is reddit
- If text field is not empty then, it is considered as a text post and link field will be ignored.
- Text field corresponds to the body of the post.
-
scheduledate field has to be a ISO Format string.
-
scheduledate and provider are mandatory fields.
โพ getallschedules
Get the all scheduled post.
The structure of a scheduled post is as follows:
{
Subreddits string
Title string
Text string
Link string
ScheduleDate string
ScheduleID int
Complete bool
Provider string
}
โพ email
Schedule Emails
Example data for the request
"to": "[email protected],[email protected]" (If multiple seperate using comma)
"template": "your-email-template",
"data": "JSON-object-to-compile-template",
"subject": "subject-of-your-email",
"scheduledate": "2020-03-06T10:46:00.000Z" (ISO DatetimeString)
Templates are compiled using raymond. So make sure your templates comply with its templating language.
โพ status
Check whether server is up and running.
Features
๐Bulk Posting
โ Automic Scheduling after crash/failure
๐ ฐ๏ธ Text and Link Posts support for reddit
๐ Status of scheduled posts
๐ฆTwitter Support
๐ Adding Postgres support
โ SMTP Support
Roadmap
Things that will be supported soon
๐ฅ Support for multiple social media accounts
Contact me
DM me on twitter. If you like my work and want to support me then buy me a coffee!