Day: May 19, 2011

My First Python Script, search on People’s Twit

import urllib import xml.dom.minidom as minidom   def printTweets(username): jumlah = 20 timeline_xml = urllib.urlopen("http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=%s&count=%s" % (username, jumlah)) xml = minidom.parse(timeline_xml) status = xml.getElementsByTagName("text")   for twit in status: mau_dicari = twit.childNodes[0].data mau_cari = mau_dicari.find(cari) if mau_cari != -1 : print "tweet:",twit.childNodes[0].data,"\n" else : pass   user = raw_input("masukkan nama user\n") cari = raw_input("masukkan yang […]