loadHTMLFile($query_url)) { if ($reverse_lookup) { $xpath = new DOMXPath($dom); $query = "//blockquote/b"; $entries = $xpath->query($query); if ($entries->length) { $url = '"' . $entries->item(0)->nodeValue . '"'; } } else { $xpath = new DOMXPath($dom); $query = "//p"; $entries = $xpath->query($query); if ($entries->length) { $url = '"' . $entries->item(0)->nodeValue . '"'; } } } echo "$callback($url);"; exit(); } ?>
The TinyURL allows the dynamic creation of TinyURLs on the fly using JavaScript.
Call the external script from your web application and pass once the URL is converted, it will pass it back via the 'callback' parameter.
To preform a reverse lookup on a tinyurl, just pass the 'tinyurl' to the API and it will workout and return where it points to.
<script type="text/javascript" charset="utf-8"> window.onload = function() { var s = document.createElement('script'); var v = document.getElementById('url').value; document.body.appendChild(s); } function tinyurlCallback(url) { alert('URL converted to: ' + url); } </script>
Submitted URLs: