Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theju/smp
Social Media Post scheduler
https://github.com/theju/smp
Last synced: 3 months ago
JSON representation
Social Media Post scheduler
- Host: GitHub
- URL: https://github.com/theju/smp
- Owner: theju
- License: mit
- Created: 2015-12-31T07:23:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T16:07:07.000Z (almost 8 years ago)
- Last Synced: 2024-07-27T06:34:01.831Z (4 months ago)
- Language: Python
- Size: 49.8 KB
- Stars: 20
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Scheduled Social Media Poster
A simple web app to schedule your Social Media Posts either through a web
interface or an API. Currently supports Facebook and Twitter.## Install
* Clone the git repo
```
git clone https://github.com/theju/smp
cd smp
```
* Install the dependencies listed in the requirements.txt
```
pip install -r requirements.txt
```
* Create the db schema. Uses sqlite3 by default. Create a local.py file under the
`smp/smp` directory to change it.
```
python manage.py migrate
```
* Run the dev server.
```
python manage.py runserver
```
* Create an admin user
```
python manage.py createsuperuser
```
* Login to the admin page at http://localhost:8000/admin/ and enter the social application
credentials at http://localhost:8000/admin/socialaccount/socialapp/
([FB app instructions](https://developers.facebook.com/apps/) and [Twitter app instructions](https://apps.twitter.com/)).
* Setup a crontab script that runs the following command every minute
```
python manage.py autopost
```## Advanced
### Schedule posts through API
* Fetch the API Key from the web interface for the user and perform a HTTP
Basic Authenticated POST request with the username as your API Key and
blank password at http://localhost:8000/api/post/add/ to schedule posts.**CURL Example**
```
curl -X POST -u -d "status=Hello+World&service=facebook&scheduled_datetime=2016-01-01T00:01:00Z" http://localhost:8000/api/post/add/
```**Requests Example**
```
import requests
import datetime
requests.post("http://localhost:8000/api/post/add/", data={
"status": "Hello World",
"service": "facebook",
"scheduled_datetime": datetime.datetime(2016, 01, 01, 00, 01, 00).strftime("%Y-%m-%dT%H:%M:%SZ"),
"scheduled_tz": "UTC"
}, auth=("", ""))
```