How do you programmatically expand a url link to its true location?

complete

Active member
Joined
Oct 24, 2012
Messages
25
Programming Experience
3-5
How do you programmatically expand a url link to its true location?

Do you know about tinyurl.com and baidu.com? Baidu.com is a search engine that tries to discourage people from using their web site to make metasearch engines by hiding their links in a way that is a lot like how tinyurl.com works. TinyUrl.com is a web site where, if you want to present someone with a link to something and that link is long, you can use tinyurl to produce a tiny url for presentation purposes.

Anyway, what I want to do is to find a way to programmatically take the link ½ÜÎ÷¿¨¡¤°¢¶û°Å_°Ù¶È°Ù¿Æ (the first link in a search for Jessica Alba using baidu.com) and have it return the actual link, ½ÜÎ÷¿¨¡¤°¢¶û°Å_°Ù¶È°Ù¿Æ . That is just one example. What I want to do is not specific to Jessica but for using Baidu.com as part of my group of search engines in my meta search engine project.

Maybe there is a way of using the WebBrowser class but I did not see a member that was the URL.

Maybe there is a way of using WebRequest and WebResponse.
 
Without making a request to the first, you'll have to find a way to decode what the value id means. Example: http://www.baidu.com/link?url=emwXGJqjJ4zBBpC8yDF8xDharCqv0FlkFWgFcEoPL1T5

Otherwise, its easy enough to just make the request and allow the redirection to take place, but why?
 
I have not gotten to the point in my code where I need to address this. I am debugging other and bigger fish.

But there is no real way to decode the id value since it is on the baidu servers.
 
I have not gotten to the point in my code where I need to address this. I am debugging other and bigger fish.

But there is no real way to decode the id value since it is on the baidu servers.

Just because (and if) it is on Baidu's database and not some interpreted value, that doesn't mean it can't be decoded. It was encoded with some algorithm, therefore unless it's combined with hashes and all of that, it may be possible to decode it back to the original link. If a hashing algorithm was used though, then this may be a bit of a stretch.

What do you mean by this? "I have not gotten to the point in my code where I need to address this. I am debugging other and bigger fish."

I have responded directly what what the question was in your original post... But that's not what you're doing now?? :S

~Ace
 
Back
Top Bottom