Twitter Status Id’s to change to string representation

I almost missed this post on the new status id generator for twitter:

Timeline
———–
by 22nd October 2010 (Friday): String versions of ID numbers will start appearing in the API responses
4th November 2010 (Thursday) : Snowflake will be turned on but at ~41bit length
26th November 2010 (Friday) : Status IDs will break 53bits in length and cease being usable as Integers in Javascript based languages

I just checked my tables – Oef ! On first look, I already store my status id’s as text… :-)

Plus of course I’m using Python, not Javascript… but it never hurts to check.

Trendlines for JQPlot are working !

At last I’ve got trendlines working ! And wouldn’t you just know it, it was just a small change that needed to be done, but the documentation is a bit old for jqplot it seems.

Mind you, I completely understand – if I understand correctly, this is just one programmer who is creating and maintaining this. His project is quite a lot bigger than mine, and I already have trouble following up and dealing with all the bugs my users find in a timely manner, let alone implement the (welcome!) suggestions on how to improve the site.

Anyway, for the record: to get trendlines to work in jqplot, you need to:

  • include the plugin in your code
  • set somewhere in your javascript part the line $.jqplot.config.enablePlugins = true;

And that’s it ! Any further configuration can be done inside the series section of the config.

Changing from feedparser.py to urllib & simplejson

With all the outages of Twitter recently, my back end system that retrieves the information from twitter was going haywire. Things kept going wrong, tweets were not retrieved, the works.

I initially coded this backend using feedparser, thinking that this code could be user later on to get rss feeds from other sites. It was a mistake to do so – I made that decision thinking that information via atom format or via json format would be similar, but this was not correct. I am *not* saying that feedparser is not good, it’s just not the right tool for the job it has to do !

The atom format that twitter returns (at current date of course – this might very well be fixed later on) is really a hodgepodge of information that is prodded and shaped into the atom format. Lots of info is repeated because really the atom format was made for larger articles of text that need a title intro, a body, etc.

All this means a much larger filesize return – certainly not enormous, but in the long run this adds up in data traffic.

Not all info that you get in json is correct in atom either. Iso_language_code which indicates the language the author primarily uses, was/is set to en-US all the time via atom format.

So with all those outages and checking and finding out that most json queries still returned correct results, I removed the feedparser lines and am now using urllib and simplejson to retrieve and parse the twitter data. Took me about 3 late evenings in a row to work through (I have a full time day job, so I only have time to do this on the train and in the evenings after 9 pm) but it’s running (almost) smooth now.

Still need to weed out a bug in my code, though – the last search does not seem to be processed… grrr.

Compiling MySQLdb for Python on mac – djeez !

This seriously needs some attention from someone with some config knowledge. Me and a horde of other python developers who transition to mac have stumbled and failed miserably on setting the python msql adapter on the mac.

Instead of using easy_install like most other python pieces you need for your project, you need to *shock, horror* download the source and compile it. Chances are too you’ll get multiple errors, depending on if you are using 32-bit or 64-bit OS X.

I’m currently running Snow Leopard, and with a change to specify the path for my_config program and telling it to compile for 64-bit

Here’s the link that solved all of my problems :Mysqldb, python and os x: a match made in Satans bum

It’s still a manual process, but at least someone found out how to fix it.

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.