Skip navigation

Tag Archives: twitter

I updated my Python Oauth Client Library so that it actually works now!

Here’s an example of how to use it:

EXAMPLE

(using Twitter)

def myCallback ( data ):
  print "data: %s" % data

c = oauthConsumer.Client( consumerKey, consumerSecret, requestTokenURL, accessTokenURL, authorizeURL, "http://example.com/check" )
c.requestAuth( myCallback )
#data: https://twitter.com/oauth/authorize?oaut..
c.requestSession( oauth_token, oauth_verifier, myCallback )
#data: oauth_token=20687908-snoIXOqT7StBdYtyeatV0fAzxLTB0DYklIgBh8klx&o...
print c._sessionSecret
#'hPxakZ3tztpiFaxulcHK9VfkCiJ4PIsL40mc9tfw'
print c._sessionToken
#'20687908-snoIXOqT7StBdYtyeatV0fAzxLTB0DYklIgBh8klx'

Now make requests via createRequest

update = c.createRequest( path="/statuses/update.json", callback=myCallback)
update.post(params = { "status":"testing pyoauthconsumer oauth client python library I'm working on" } )
#data: {"truncated":false, ... }

You can see the post made with this example here.

Advertisements

Wrote an app engine app to block spammers on Twitter. It needs a little work and love, but it will help you if you only have a hundred followers. If you have more then you might have to run it several times.

It’s open source, but I wrote very quickly so not much to look at the moment. Here’s a screenshot:

Kill Bills Screenshot

Given that the Twitter Developer wiki is a piece of shit, because you can’t actually edit it, so it’s not really a wiki, there’s a lot of important information missing.

This page will hopefully add information that can’t be added to Twitter’s wiki as it’s a piece of shit.

Twitter oauth URLS:

Request token url: ‘http://twitter.com/oauth/request_token’

Access token url: ‘http://twitter.com/oauth/access_token’

Authorization url: ‘http://twitter.com/oauth/authorize’

Other

Twitter’s oauth parameter names are as given in the specification.

Finally

Twitter, your developers wiki is a piece of shit and you should fire whoever is the fucking moron responsible for making a wiki that can’t be edited by people who want to helpful. Thank you.