Update:
It turns out that Twitter doesn’t know single tweet ID from URL fragment segment. What it does is have “lastest tweet of last viewed twitter” in the inline JavaScript. If you view somebody’s profile and then go to his/her last tweet single page. The inline JavaScript has text of the last tweet by the author.
Original Question:
Each tweet has a single URL such as http://twitter.com/#!/DeliciousHot/status/23189589820702720. The tweet identification (/DeliciousHot/status/23189589820702720) is in the URL fragment segment which is not actually sent to server.
Originally, I thought it works this way:
The URL response doesn’t have this tweet specific info. It is JavaScript module that extracts tweet id from current browser URL and fetch tweet payload with AJAX. The page content is then updated with the tweet payload.
To my surprise, it doesn’t work this way!
With Firebug, you can view that response of http://twitter.com/#!/DeliciousHot/status/23189589820702720 has tweet payload “10 Signs of a True Gentleman” text in inline JavaScript. The tweet payload is not fetched by another AJAX.
So, how does Twitter server get to know the expected tweet ID even it is in URL fragment segment?
Two methods:
When you’re not logged in, it has a redirect:
When you are logged in, it makes a call to api.twitter.com:
I have no idea where in the code this happens, but the developer tools logged it.