Posts

Showing posts with the label twitter

OAuth with tweepy

VIA:  https://github.com/tweepy/tweepy/blob/4799c740a20882e854a636e2721164cd5841a6c8/doc/auth_tutorial.rst OAuth Authentication OAuth is a bit trickier than basic auth, but there are some advantages to using it: You can set a 'from myappname' which will appear in tweets posted More secure since you don't need the user's password Your app does not break if the user changes their password in the future Tweepy tries to make OAuth as painless as possible for you. To begin the process we need to register our client application with Twitter. Create a new application and once you are done you should have your consumer token and secret. Keep these two handy, you'll need them. The next step is creating an OAuthHandler instance. Into this we pass our consumer token and secret which was given to us in the previous paragraph: auth = tweepy.OAuthHandler(consumer_token, consumer_secret) If you have a web application and are using a callback URL that needs to be supplied dy...

Tutorial: consuming Twitter's real-time stream API in Python

VIA:  http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars/ import pycurl, json STREAM_URL = "http://chirpstream.twitter.com/2b/user.json" USER = "segphault" PASS = "XXXXXXXXX" def on_receive(data):   print data conn = pycurl.Curl() conn.setopt(pycurl.USERPWD, "%s:%s" % (USER, PASS)) conn.setopt(pycurl.URL, STREAM_URL) conn.setopt(pycurl.WRITEFUNCTION, on_receive) conn.perform()

iPhone URI scheme

hi this is a great collection of URI schemes to launch other applications like facebook and twitter from your own code. http://wiki.akosma.com/IPhone_URL_Schemes