Python Twitter API v1.1 Released
Hi all!
So I've just made a couple of small additions to my Twitter API wrapper recently. Twitter limits the number of requests that a client can request data, as such if my wrapper was used on a high traffic site for example, the limit of requests could be reached very quickly.
I've added caching functionality which saves requested data on a minute by minute basis. E.g. if a request is made where the cached data is older than 1 minute, the data from that request is cached in order for any subsequent requests to use that data rather than many a new request to Twitter. This is beneficial in both allowing your tweets will be shown regardless of the number of requests that are made, and that it also speeds up the process.
The other improvement is the wrapper is now generating hyperlinks around hashtags, user mentions and URLs within each tweet. For an example please see my tweets under the Twitter heading on the right.
I have also made the caching mandatory, but if enough people ask for this to be configurable I'll make it so. As such the constructor for creating a new Twitter object has changed
Just a short one today, but you can download the new version here, and view my previous blog post for usage instructions.
So I've just made a couple of small additions to my Twitter API wrapper recently. Twitter limits the number of requests that a client can request data, as such if my wrapper was used on a high traffic site for example, the limit of requests could be reached very quickly.
I've added caching functionality which saves requested data on a minute by minute basis. E.g. if a request is made where the cached data is older than 1 minute, the data from that request is cached in order for any subsequent requests to use that data rather than many a new request to Twitter. This is beneficial in both allowing your tweets will be shown regardless of the number of requests that are made, and that it also speeds up the process.
The other improvement is the wrapper is now generating hyperlinks around hashtags, user mentions and URLs within each tweet. For an example please see my tweets under the Twitter heading on the right.
I have also made the caching mandatory, but if enough people ask for this to be configurable I'll make it so. As such the constructor for creating a new Twitter object has changed
Twitter(user, noOfItems, path/to/file)
twit = Twitter("elspiko", 3, "/var/www/test/twittercache.xml")
The file can reside in any location on the filesystem (that has
read/write access for the web service user), but must end in
.xmlJust a short one today, but you can download the new version here, and view my previous blog post for usage instructions.