@verbose
def streamtofile_demo(limit=20):
 oauth = credsfromfile()
 client = Streamer(**oauth)
 client.register(TweetWriter(limit=limit, repeat=False))
 client.statuses.sample()

@ verbose def streamtofile_demo ( limit = 20 ) : oauth = credsfromfile ( ) client = Streamer ( ** oauth ) client . register ( TweetWriter ( limit = limit , repeat = False ) ) client . statuses . sample ( )
write 20 tweets sampled from the public streaming api to a file .