Title: Cloning the Twitter badge with Javascript &amp; new subdomain
Slug: cloning-the-twitter-badge-with-javascript-and-new-subdomain
Date: 2007-10-27 11:25:00
Author: Kartones
Lang: en
Tags: Development, Javascript, Social Networks
Description: A project involving cloning the Twitter badge using Javascript and a new subdomain.

 <p>The night from thursday to friday I slept few hours, but it was not because of going out. <strong>Pedroafa</strong> 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).</p>

<p>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.</p>

<p>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.</p>

<p>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).</p>

<p>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).</p>
