Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social poster to Facebook and Twitter #90

Merged
merged 25 commits into from
Jan 10, 2015
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
991eca7
the worker can post to facebook and twitter when new plans are scraped
florpor Nov 11, 2014
ff176f0
helper script to get facebook acess tokens for posting to pages
florpor Nov 12, 2014
36cebb8
get_facebook_token note
florpor Nov 12, 2014
80d71b7
formatting and clarity to user
florpor Nov 12, 2014
0dd4eb0
helper script to get twitter acess tokens for posting to feed
florpor Nov 12, 2014
14d0521
seperated requirements that are only for scripts from main requiremen…
florpor Nov 12, 2014
ad65fa5
social posting documentation and a bit of space formatting
florpor Nov 12, 2014
029d572
can never get this markdown right the first time
florpor Nov 12, 2014
3de0b51
updated test_requirements.txt for travis
florpor Nov 12, 2014
fcf6e17
moved social posting to a detached service. re-ordering of helpers
florpor Dec 2, 2014
d58c3b6
removed social requirements from test_requirements.txt
florpor Dec 2, 2014
1b08745
updated deployment readme
florpor Dec 2, 2014
db6af05
moved social token storage to poster service
florpor Dec 29, 2014
ef88557
merged master
florpor Dec 29, 2014
88279af
accidentally dropped import at merge
florpor Dec 29, 2014
1d4365f
moved social token scripts to opentaba-poster and updated deployment …
florpor Dec 29, 2014
74cf58c
Merge branch 'master' into social_poster
florpor Dec 29, 2014
03dae80
changed tools folder to lib. moved create_db and update_db to scripts…
florpor Dec 29, 2014
b913aa2
helpers crawled back to app.py when i merged
florpor Dec 29, 2014
87388de
added sync_poster script
florpor Jan 1, 2015
4140562
forgot to fix update_db script's imports
florpor Jan 1, 2015
17cd233
POSTER_SERVICE_URL shouldn't have the /post part, then we can properl…
florpor Jan 1, 2015
3534652
fix tests
florpor Jan 1, 2015
8d3ec84
merged changes from master
florpor Jan 5, 2015
0a7322a
merged changes from master
florpor Jan 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
can never get this markdown right the first time
florpor committed Nov 12, 2014
commit 029d572ac6607c964f9579135c3a26b9ce041850
13 changes: 9 additions & 4 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -32,15 +32,19 @@ You can enable Facebook only, Twitter only or both, and can also enable Bit.ly a
####Facebook
The needed variables for Facebook posting are `FB_TOKEN` and `FB_PAGE_ID`, which correspond to the page access token after you gave the publisher app the `manage_pages` permission, and the page's id.
To set them run (opentaba-server-holon is the application name in this example and the ones below):
`heroku config:set FB_TOKEN="token" --app opentaba-server-holon
heroku config:set FB_PAGE_ID="page_id" --app opentaba-server-holon`
```
heroku config:set FB_TOKEN="token" --app opentaba-server-holon
heroku config:set FB_PAGE_ID="page_id" --app opentaba-server-holon
```
####Twitter
The needed variables for Twitter posting are `TW_TOKEN`, `TW_TOKEN_SECRET`, `TW_CONSUMER` and `TW_CONSUMER_SECRET`, which correspond to the access token after you authorized the publiser app, the access token secret and the publisher app's consumer key and consumer secret.
To set them run:
`heroku config:set TW_TOKEN="token" --app opentaba-server-holon
```
heroku config:set TW_TOKEN="token" --app opentaba-server-holon
heroku config:set TW_TOKEN_SECRET="token_secret" --app opentaba-server-holon
heroku config:set TW_CONSUMER="consumer" --app opentaba-server-holon
heroku config:set TW_CONSUMER_SECRET="consumer_secret" --app opentaba-server-holon`
heroku config:set TW_CONSUMER_SECRET="consumer_secret" --app opentaba-server-holon
```
####Bit.ly
If you want links to be shortened before they are posted, you can enable Bit.ly shortening (not a must for neither Facebook nor Twitter posting).
The needed variable is only `BITLY_TOKEN`. Set it by running: `heroku config:set BITLY_TOKEN="token" --app opentaba-server-holon`
@@ -50,6 +54,7 @@ There are two helper scripts made to help you authorize the Facebook and Twitter
Before you can run them there are two things you must do:
1. Install their required libraries on your environment, ie. `pip install -r scripts/requirements.txt`
2. Set the app id and app secret on the Facebook script, or consumer key and consumer secret on the Twitter script. These are obviously not provided with the script, and are attainable at both apps' settings pages.

####Facebook
Run the `scripts/get_facebook_token.py` script, and browse [http://0.0.0.0:8080](http://0.0.0.0:8080).
After authorizing the app, you will be redirected to a page which will list all your pages, their ids and their access tokens. Our server only posts to one page, so pick one and set the environment variables accordingly.