How can I retrieve the full URL from shortened url from bit.ly

I am parsing some RSS feeds on my website and need to find the original url from  bit.ly urls. How can I find that?

for example the bit.ly url is like this,  http://bit.ly/dyT34dW0 .. i need this url expanded ..like this, http://www.test.com/test.html
LVL 36
Loganathan NatarajanLAMP DeveloperAsked:
Who is Participating?
 
yadayaCommented:
You can use bit.ly API
bitly API Documentation
0
 
GkCommented:
You can use an http connection to get the redirect address for the short address. get the redirect address for the status 301 !
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
GkCommented:
if you dont have any username/ref key?

<textarea id="abc" style="width:300;height:100"></textarea>
<script>
      var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      //var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
        xmlhttp.open("POST","http://www.knowurl.com/y.php", true);
      xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
      xmlhttp.send("url=http://bit.ly/eyDUrC");
      xmlhttp.onreadystatechange=function()
        {
            if(xmlhttp.readyState==4 && xmlhttp.status==200)
               {
                  document.getElementById("abc").innerText = xmlhttp.responseText;
            }
            
      }

</script>
0
 
Ray PaseurCommented:
The example is a 404 page.  If you can give us a REAL, WORKING bitly URL, we might be able to give you back the PHP code that extracts the original URL.
0
 
Loganathan NatarajanLAMP DeveloperAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.