Programs ... SelfRefTweet

General

SelfRefTweet is a program written for the generation of self referential tweets. It is part of a challenge posted on twitter by Mark Reid which I learned through Diomidis Spinellis. A self referential tweet is one which contains the url http://www.twitter.com/username/status/123456789 where 123456789 is the id of the tweet. This url is the unique url which contains the tweet posted by the user. In effect, it is a reference to itself.

Technical information

After posting some tweets I found out that the ids are assigned incrementally. Furthermore, if you post 3 tweets at once, the difference between the ids of the first two is about the same as the difference of the last two. What this program does is create some test tweets, find the difference between their ids, and then post some tweets that contain links to tweets with id computed using the last id of the tweet and the previously computed difference. You can see more information by studing the source code.

The program is written in perl and requires only the standard perl modules.

Usage

Option password requires an argument
Usage: ./genselfref.pl [options]
Valid options are:
        -username  Your twitter username
        -password  Your twitter password
        -tt        The test tweets
        -ft        The final tweets
        -fail      The fail difference
        -help      This help
        -version   Output version and exit
        

You must be carefull about the number of the test tweets and the final ones. If you generate a lot of tweets you may have problems due to the limits imposed by twitter. Furthermore, using a lot of test tweets may lead to problems if the mean difference between tweets changes rapidly (yes, it happens, I've seen it)! If this is the case then the expected id and the real id will have a big diffence. If this rises above the specified fail difference the program will stop so you can limit the values.

Download

The program is available for download here.

License

The program is licensed under the terms of the MIT license.