From: Florian Diesch on


<http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars>
has some explanations about how to use real-time stream API

>"eka (Esteban)" <ekagaurangadas(a)gmail.com> writes:
>
> IMO the real time update is your work to do.
>
> You can poll, to say, each 1 minute or less and then you will have
> your real time tweets update.
>
>
> On Apr 14, 9:08�am, Harshad Joshi <firewal...(a)gmail.com> wrote:
>> import twython.core as twython, pprint
>> import codecs
>>
>> # Authenticate using Basic (HTTP) Authentication
>> twitter = twython.setup(username='yourname', password='yourpassword')
>> friends_timeline = twitter.getFriendsTimeline(count="60", page="2")
>>
>> a=codecs.open('twython_log.txt','a','utf-8')
>> for tweet in friends_timeline:
>> � � � � print "\n"+tweet["user"]["screen_name"]+">>"+ tweet["text"]
>> � � � � d="\n"+tweet["user"]["screen_name"]+">>"+ tweet["text"]
>> � � � � a.write(d)
>>
>> a.close()
>>
>> This is the code I wrote but I doubt if its a live stream i am
>> receiving.
>>
>> I wanted some real time updates from my friends. The above code
>> fetches data from the 'latest' friends tweet and continues till 60th
>> tweet. It doesent do anything about the new tweet that might come from
>> someone.
>>
>> On Apr 11, 9:34�pm, Atul Kulkarni <atulskulka...(a)gmail.com> wrote:
>>
>> > Hi Harshad,
>>
>> > It depends on what you want those updates for? If it is a client then you
>> > will have to stick with the methods you have described but if you are
>> > writing and server end application then you can think of using streaming api
>> > with follow predicate. This will feed in to your application live updates
>> > from the people you are following. But do not use streaming api if you
>> > thinking of a client, as streaming API could be overwhelming for the client
>> > side application.
>>
>> > Tweepy has code examples, which should help you with the sample code. Just
>> > my 2 cents.
>>
>> > Regards,
>> > Atul.
>>
>> > On Sat, Apr 10, 2010 at 12:34 AM, Harshad Joshi <firewal...(a)gmail.com>wrote:
>>
>> > > In the original twitter api, there was a method like
>>
>> > > a=twitter.Api('user','password')
>>
>> > > b=a.GetFriendsTimeline()
>>
>> > > where we could get the friends time line after authentication. It used
>> > > to show maximum 20 tweets at a time.
>>
>> > > Is there any similar method available in tweepy which will show live
>> > > updates? If yes, then what is the maximim number of tweets being
>> > > shown?
>>
>> > > I would like to see a code snippet of the above method.
>>
>> > > --
>> > > To unsubscribe, reply using "remove me" as the subject.
>>
>> > --
>> > Regards,
>> > Atul Kulkarni


Florian
--
Simple dict-like Python API for GConf:
<http://www.florian-diesch.de/software/easygconf/>