Cloning the Twitter badge with Javascript & new subdomain

The night from thursday to friday I slept few hours, but it was not because of going out. Pedroafa and I started to play with the Twitter API and a visual clone (using only javascript and HTML) I had already done of its badge (which is a flash object).

At first, we used the RSS url Twitter exposes to fetch the entries. I sticked to that approach (building a small javascript XML parser) while Pedro discovered that Twitter can expose too the entries in JSON and tried that.

I finished my version first, but it had a nasty effect: Twitter adds the username before each entry text... So I we ended using Pedro's JSON version.

To circumvent the cross-domain AJAX restrictions (you can't do an AJAX query to a domain name), I built a small ASP.NET proxy that gets the original URL and simply outputs it (so AJAX calls can be made to the proxy inside my domain).

I'll change some bits to be able to add to any blog of the community (and in the future, build a Community Server control).

Tags: Development

Cloning the Twitter badge with Javascript & new subdomain article, written by Kartones. Published @