Skip to content

rahulnpadalkar/Sheddit

Repository files navigation

⏱Sheddit

Sheddit

rahulnpadalkar License: MIT

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

  1. Go to reddit's app creation page
  2. Create an app, remember to select script from the radio button menu.
  3. Note down client secret and client id (both will appear in the app details once it is created)

Get keys for twitter

  1. Go to Twitter Developer Account and apply for a developer account.
  2. Fill in the application. Verify your email address by clicking on the link sent in verification mail by twitter (after you complete application).
  3. After successful verification go to create application dashboard and click on create app.
  4. Fill in the application and hit create. (Filling only the required fields will suffice)
  5. 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.)

  1. 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

  1. 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

  1. When the provider is twitter

    1. Text corresponds to the tweet text
  2. When the provider is reddit

    1. If text field is not empty then, it is considered as a text post and link field will be ignored.
    2. Text field corresponds to the body of the post.
  3. scheduledate field has to be a ISO Format string.

  4. 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":           "test@test.com,test2@test.com" (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!

About

🚀A Go program to schedule posts for reddit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published