Some of you may have recognized that twitter has disabled the so called Basic Authentication. So my previous twitter-tools don’t work anymore. But don’t bury your head in the sand, here are the newer versions.
Basic Authentication means you send your account information (username/password) unencrypted with your query (status update/timeline request/…) to twitter. Of course this method isn’t a nice way, so twitter disabled this method of authentication.
But the new methods of API calls are more complicated (called “OAuthcalypse”) and I really don’t like them. But whoever listens to me?
If you now want to interact with the twitter API, you have to register your tool as new twitter tool. Don’t ask me why, but you have to choose an unique name (all over the twitter world) for your application and get some random strings. For example for a Perl script you need the ones called Consumer key and Consumer secret.
If you want to interact with twitter, you have to do the following:
<li>send the combination of <em>Consumer key</em> and <em>Consumer secret</em> to the server <li>receive an URL from the server where the user itself can find a pin code (when (s)he is logged into twitter) <li>send this code to the server again and the user is verified <li>receive some more authentication information from the server, store it for the next time, so the user don't have to authenticate again
Very annoying method, but there is no alternative method and at least your account is more save against hijacker.
By the way I found a Perl module called Net::Twitter that helps a lot.
Here is my snippet to solve this authentication stuff:
Ok, you see it’s not impossible to solve this problem. And there is another advantage, with these two scripts I don’t have to provide my username/passwort any more.
To use my tools just download them to your machine, rename them as you want and then just run it:
- To tweet something call
tweet-v2.plwith your status message as argument.
- To get latest informations from the people you are following just call
twitstat-v2.plwith an optional argument defining the maximal number of messages you want to see.
For the first time you’ll see a link where you’ll get your pin (open the link with your browser), after wards the tools will store your credentials in
[toolname].credentials . Just try it, won’t (hopefully) break anything :P
- hacked (25) ,
- media (59) ,
- network (75) ,
- programming (72) ,
- security (30) ,
- twitter (9) ,
- ugly (26) ,
- userinteraction (27)