Package: tastytweets
OverviewThis is a mashup that uses three APIs:Delicious feedsBacktweets API(optionally)Twitter APIIt works as follows:fetch a list of urls tagged on delicious (which whatever tag(s) you specify)query backtweets to find users who’ve posted links to those urlsreturn a list of those users’ twitter usernamesIf you want, you can:either just find the usernames; orautomatically start following the users you find on twitterIf you really like the idea, you can automate the script to check for new users
to follow every few hours (the delay is configurable).The idea is that you can find people who are interested in sites you’re interested
in. If you find that by automatically following them they happen to follow you
back, well, who knows, maybe this little package will make you famous ;)How useful it is will depend on the sites you tag.  Havinghttp://www.yahoo.comin there is not likely to be much of a useful filter.  Wheras having something
specialist like, say,http://tav.espians.com, probably will be.Prerequisitesyou’ll need a unix based computer atm; this is due to thepython-crontabdependency which we’re using to schedule tasks.  There are many others ways of
scheduling tasks, if you’d like to improve the package and make it windows
compatible, pleasego ahead;)you needPythonyou’ll need aDeliciousaccountyou’ll need aBacktweetsAPI keyif you want to automatically follow the users you’ll need aTwitteraccountUsageInstall it:$ easy_install tastytweetsThis installs a number of console scripts (it’ll put them where your python puts
scripts). To find all twitter users who’ve posted on the URLs you’re
interested in:$ ./path/to/bin/tastytweets-find [... options ...]tastytweets-findis the simplest way of using this package, especially if
you don’t like the way the automation that follows has been implemented.Find and automatically follow those users (in real life on your twitter account, for real,
don’t do this unless you actually mean to!!):$ ./path/to/bin/tastytweets-follow [... options ...]Automate the script (to run forever) to check for new users to follow every
6 hours:$ ./path/to/bin/tastytweets-automate [... options ...] --follow-delay 6The command line options required vary according to what you’re trying to do.
To see all the options, run one of the scripts with the-hoption:$ ./path/to/bin/tastytweets-find -hThe default tag the script looks for in your delicious account is ‘follow’ but
you can pass any tags using the-toption, e.g.:-tfoo bar doloreswill only pick up urls tagged withfooandbaranddolores(n.b.: it’s
cumulative, like'foo' AND 'bar' AND 'dolores').For example, a fully optioned-up call might be [line wraps are marked\]:$ ./path/to/bin/tastytweets-automate -u TWITTER_USERNAME -p TWITTER_PASSWORD \
-k BACKTWEETS_KEY -d DELICIOUS_USER -t follow socialgraphing \
--follow-delay 6 --push-delay 5There are two implementation details you should be aware of.  Firstly, Twitter
has a limit of 100 requests per hour, so the script also uses a directory queue
to store requests to make on the filesystem and adds a cronjob (for the duration
of the queue being full) to process one request every--push-delayminutes.
This defaults to every 5 minutes.Secondly, the package is designed primarily to be automated, so it maintains an
internal record of the last time it checked for posts.  If you want to use the./tastytweets-findor./tastytweets-followscripts manually, you may want
to reset the internal record so that you get all of the posts.To reset the last time checked:$ ./path/to/bin/tastytweets-reset-status-idTo reset the last time-checked, reset the queue, destroying any pending requests
and delete any crontab jobs scheduled:$ ./path/to/bin/tastytweets-reset-everythingTo manually push queued follow requests use:$ ./path/to/bin/tastytweets-pushYou shouldn’t need to though, astastytweets-followtakes care of pushing
automatically.Finally, you can also, of course, use the package directly from python.  Seetastytweets.client.TastyTweeter.__doc__for details.