Facebook, Twitter robots for publishing legislations.
$ sudo apt-get install redis-server redis-tools
$ redis-server
$ pip install -r requirements.txt
$ cp settings.py.sample settings.py
-
Create Twitter Consumer Key
- Create an app at https://apps.twitter.com/
- Raise the access level to 'Read and Write'
- Copy consumer key and consumer secret to
TWITTER_CONSUMER_KEY
,TWITTER_CONSUMER_SECRET
insettings.py
-
Create OAuth Token
$ python twitter.py
- Open the link given by the program. (Make sure to login as the user that you want to tweet posts)
- Copy and paste the verification code given in the browser into the command line.
- Then you'll get oauth token and oauth token secret.
- Copy and paste them into the blanks of
settings.py
:TWITTER_OAUTH_TOKEN
,TWITTER_OAUTH_TOKEN_SECRET
-
Create Facebook Client ID
- Create new App
- Copy App ID, App Secret to
FACEBOOK_CLIENT_ID
,FACEBOOK_CLIENT_SECRET
insettings.py
-
Create page short access token
- Go to the Graph API Explorer
- Choose your app from the dropdown menu
- Click "Get Access Token"
- Choose the
manage_pages
permission - Copy
Access Token
and paste toFACEBOOK_OAUTH_TOKEN
insettings.py
-
Create page long access token
$ ./post.py facebook --test # Uploads post to `pokrbottest`
$ ./post.py facebook
$ ./post.py twitter --test
$ ./post.py twitter
- Apache 2.0