[Assorted-commits] SF.net SVN: assorted:[1526] sandbox/trunk/src/one-off-scripts
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-12-03 21:28:16
|
Revision: 1526 http://assorted.svn.sourceforge.net/assorted/?rev=1526&view=rev Author: yangzhang Date: 2009-12-03 21:27:57 +0000 (Thu, 03 Dec 2009) Log Message: ----------- added tweetrec Added Paths: ----------- sandbox/trunk/src/one-off-scripts/tweetrec/ sandbox/trunk/src/one-off-scripts/tweetrec/README sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py Added: sandbox/trunk/src/one-off-scripts/tweetrec/README =================================================================== --- sandbox/trunk/src/one-off-scripts/tweetrec/README (rev 0) +++ sandbox/trunk/src/one-off-scripts/tweetrec/README 2009-12-03 21:27:57 UTC (rev 1526) @@ -0,0 +1 @@ +Simply dumps the stream to stdout. Specify username and password in ~/.tweetrec.auth. Requires tweepy. Added: sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py =================================================================== --- sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py (rev 0) +++ sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py 2009-12-03 21:27:57 UTC (rev 1526) @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +from tweepy.streaming import * +import os, sys + +class MySl(StreamListener): + # on_data's dicts are actually more useful than on_sample's Sample objects. + def on_data(self, status): + print status, + +with file(os.path.expanduser('~/.tweetrec.auth')) as f: u,p = map(str.rstrip, f.readlines()) +Stream(u, p, MySl()).sample() Property changes on: sandbox/trunk/src/one-off-scripts/tweetrec/tweetrec.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |