twitter data

Alexey Zakhlestins created php-twitterdata, a small library for working with Twitter data in PHP. The idea is to embded machine-readable data in twitter that could be parsed and used in other applications. From the official website :

Twitter Data is a simple, open, semi-structured format for embedding machine-readable, yet human-friendly, data in Twitter messages. This data can then be transmitted, received, and interpreted in real time by powerful new kinds of applications built on the Twitter platform. Here is an example TwitterData message:

I love the #twitterdata proposal! $vote +1

The part with the dollar sign, $vote +1, is a piece of data embedded using the TwitterData format.

Sample usage of PHP Twitter Data

// Create a TwitterData to send :
$message = ‘Hello, world! ‘.TwitterData::array_to_TwitterData(array(‘foo’ => ‘bar’));
// Hello, world! $foo bar
// Parse TwitterData recieved from Twitter :
TwitterData::TwitterData_to_array(‘Hello, world! $foo bar’);
Twitter data

Twitter applications could be more fun with TwitterData especially that you could easily parse and use data embdded in tweets directly in your application. Be sure to check Alexey’s post, he provides details on working with the library and using TwitterData_Message, TwitterData_Frame and TwitterData_Tuple classes. The library is released under a MIT-style license.