View Single Post
Old 09-26-2009, 01:52 PM   #7 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I know this is an old topic, but given the recent bump it should be ok to have a quick chat on the subject.

When trying to resolve where TinyURLs are supposed to go, wouldn't it make more sense just to send a HEAD request to the TinyURL and see where it points rather than scraping the service-specific preview page in the hope the HTML reflects what you want and the value there is accurate.

The HEAD request method should also work across a wide number of URL shortening services making your code much easier if you wish/need to handle multiple services.
Salathe is offline  
Reply With Quote