Skip to content

Commit

Permalink
twitter_tester
Browse files Browse the repository at this point in the history
  • Loading branch information
prehensile committed Jun 17, 2012
1 parent 486cc4f commit c4992ca
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions twitter_tester.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import twitterconnector
from messages import streetnoise
import logging

logging.basicConfig( filename="twitter_tester.log", level=logging.INFO, filemode='w' )
console = logging.StreamHandler()
console.setLevel(logging.INFO)
logging.getLogger('').addHandler(console)

logging.info( "Starting up Twitter connector..." )
twitter_connector = twitterconnector.TwitterConnectorThread()
twitter_connector.creds_path = "twitter_creds"
twitter_connector.track_keywords = ["lndlrd"]
twitter_connector.start()

abortflag = False

while not abortflag:
new_statuses = twitter_connector.pop_stream()
for status_in in new_statuses:
try:
message_out = streetnoise.message_for_incoming_status( status_in )
logging.info( message_out )
except Exception, e:
print( e )
time.sleep(1)

0 comments on commit c4992ca

Please sign in to comment.