Giter Site home page Giter Site logo

opentaba-poster's Introduction

opentaba-poster

A social poster for the opentaba-server project.

This project is an independant service that can recieve a title, content and url from opentaba-server and post it to Facebook and Twitter, while in the process shortening the url using Bit.ly. To use it just run it (heroku ready), and point your opentaba-server instance to it using the instruction found at the DEPLOYMENT readme.

###Enabling 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 poster

###Adding a New Poster No interface at the moment, to add a new poster with tokens and an assigned id, add a new document to the database that looks like this (Facebook is not dependent upon Twitter, and vice-versa. Technically, no fields are mandatory besides id):

{
    "id": "1",
    "desc": "opentaba-server-holon",
    "fb_tok": "holon-facebook-token",
    "fb_page": "holon-facebook-page-id",
    "tw_tok": "holon-twitter-token",
    "tw_tsec": "holon-twitter-token-secret",
    "tw_con": "holon-twitter-consumer-id",
    "tw_csec": "holon-twitter-consumer-secret"
}

A new poster can now be added using a fabric task which exists in the opentaba-server repository. Further details can be found on its Deployment Readme.

###Getting The Tokens There are two helper scripts made to help you authorize the Facebook and Twitter apps, which require manual web authorization, and get your access tokens easily. 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. 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. ####Twitter Run the scripts/get_twitter_token.py script, and browse http://0.0.0.0:8080. After authorizing the app, you will be redirected to a page with your access token and access token secret. ####Bit.ly Simply go to the Bit.ly website's apps page and generate a generic access token, which you can use.

opentaba-poster's People

Contributors

florpor avatar

Watchers

Nir Yariv avatar Meir Kriheli avatar Shahar Evron avatar Ofri Raviv avatar Paul Walsh avatar James Cloos avatar Ori Hoch avatar Alonisser avatar  avatar Yotam avatar Mary avatar Hostmaster avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.