Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rahulnpadalkar/Sheddit

๐Ÿš€A Go program to schedule posts for reddit.
https://github.com/rahulnpadalkar/Sheddit

hacktoberfest

Last synced: 4 days ago
JSON representation

๐Ÿš€A Go program to schedule posts for reddit.

Awesome Lists containing this project

README

        

# โฑSheddit

![Sheddit](https://i.imgur.com/ZZbe5cW.png)

[![rahulnpadalkar](https://circleci.com/gh/rahulnpadalkar/Sheddit.svg?style=shield)](https://circleci.com/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## ShedditUI

[ShedditUI](https://github.com/rahulnpadalkar/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](https://ssl.reddit.com/prefs/apps)
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](https://developer.twitter.com/en/apply) 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](https://developer.twitter.com/en/apps) 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": "[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](https://github.com/aymerick/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](https://twitter.com/rahulnpadalkar). If you like my work and want to support me then [buy me a coffee](https://www.buymeacoffee.com/1UyiBMG)!