Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-04-26
6
Medium Priority
?
341 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Loganathan Natarajan
6 Comments
 
LVL 3

Expert Comment

by:yadaya
ID: 35466227
You can use bit.ly API
bitly API Documentation
0
 
LVL 2

Accepted Solution

by:
Gk earned 2000 total points
ID: 35466329
0
 
LVL 2

Expert Comment

by:Gk
ID: 35466401
You can use an http connection to get the redirect address for the short address. get the redirect address for the status 301 !
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:Gk
ID: 35466870
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
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35466935
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
 
LVL 36

Author Closing Comment

by:Loganathan Natarajan
ID: 35472796
thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question