Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
The Selective Tweets Facebook app for selectively posting tweets to your Facebook profile and/or page(s)
branch: master

This branch is 20 commits behind andyyoung:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
cli
config
cron
lib
templates
www
wwwadmin
LICENSE
README
logs

README

Selective Tweets
================

Copyright (c) 2009-2012 Andy Young <andy@apexa.co.uk> @andyy
License: MIT
https://github.com/andyyoung/Selective-Tweets

This is the source code for Selective Tweets - an app that enables people that use both Facebook and Twitter
to cross-post Tweets to their Facebook profile or page using the #fb hashtag.

The app can be found at
http://apps.facebook.com/selectivetwitter/

Source code released January 2012 under the MIT licence. You are free to use this code for educational
purposes, create derivative works and redistribute so long as you retain the original licence and copyright
notices acknowledging myself as the original author. Be innovative, don't be evil.


Requirements
============

Pretty simple:
 - PHP under Linux
 - A web server (I use Apache)
 - MySQL database
 - Cron for scheduling jobs


How it works
============

The app provides a web interface based on the Facebook PHP SDK enabling users logged into Facebook to configure
a Twitter account to watch for tweets. It then collects tweets containing the #fb hashtag using Twitter's
streaming API and stores them in a database-based queue (MySQL). A daemon run every couple of minutes processes
the queue of tweets, matches them against records of Facebook profiles/pages and compiles Facebook Graph API
batch requests to cross-post updates as appropriate.


To get set up
=============

 - edit config/config.php
 - create DB according to config/database_schema.sql
 - make www/ available under a webserver
 - execute cron/check_stream_tracker.php to start tracking the twitter stream
 - run the CLI scripts under cron/ on a regular basis to do the work

References
==========

 - Twitter Streaming API: https://dev.twitter.com/docs/streaming-api
   - PHP Phirehose library: https://github.com/fennb/phirehose
 - Facebook Graph API: http://developers.facebook.com/
   - Facebook PHP SDK: https://github.com/facebook/facebook-php-sdk


Have fun!

Andy Young
T: @andyy
E: andy@apexa.co.uk
B: www.insomanic.me.uk
Something went wrong with that request. Please try again.