Sort of bloated for such a simple script really. (sorry
)
Instead of using the standard form for creating the TinyURL, and then having to parse out the result, just use the API creating script.
e.g.
http://tinyurl.com/api-create.php?url=http://www.google.com
This way, if the TinyURL guys change the formatting of the resulting page of the standard form, your script won't work any more. (Ok, they might change the API page too, but it's less likely)