Skip to content

Commit a36af92

Browse files
committed
Merge pull request #12 from joythewizard/master
Added tweets search example
2 parents e731577 + 353ac4d commit a36af92

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Examples/loklak-tweets-search.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from loklak import Loklak
2+
import json
3+
4+
myTweets = Loklak()
5+
6+
movieName = raw_input("What movie would you like to search recent tweets for? ") #asks for what user would like to search for
7+
8+
index = 1
9+
for tweet in myTweets.search(movieName)["statuses"]: #searches movie and finds "statuses" where "text" is under
10+
print '%d%s' %(index, '.') #prints the tweet number
11+
print tweet["text"] + "\n" #prints the text of the tweet and makes a new line
12+
index+=1 #increments index
13+

0 commit comments

Comments
 (0)