Twitter by Python
Search
Sample program#!/usr/bin/python #coding: utf-8 import feedparser import urllib queryword = u'`R[g' #unicode queryword = queryword.encode('utf-8') #encode queryword = urllib.quote(queryword) #URL encode url = 'http://search.twitter.com/search.atom?q=' + queryword print url print fdp = feedparser.parse( url ) for entry in fdp['entries']: if( 'date' in entry ): date = entry['date'] print 'date:'+date.encode('utf_8') if( 'title' in entry ): title = entry['title'] print 'title:'+title.encode('utf_8') if( 'link' in entry ): link = entry['link'] print 'link:'+link.encode('utf_8') printSample program
Link
GET search | Twitter DevelopersHow bona! [Python RSS]