tinyurl

Using tinyurl.com in a .Net application … possible?

白昼怎懂夜的黑 提交于 2019-11-30 03:39:10
I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically create a tinyurl url. Is there a way to do this using code, specifically C# in ASP.NET? You should probably add some error checking, etc, but this is probably the easiest way to do it: System.Uri address = new System.Uri("http://tinyurl.com/api-create.php?url=" + YOUR ADDRESS GOES HERE); System.Net.WebClient client = new System.Net.WebClient(); string tinyUrl = client.DownloadString(address); Console.WriteLine(tinyUrl); After doing some more research ... I

How does a URL Shortener work? [closed]

蓝咒 提交于 2019-11-29 20:05:38
I wonder how a URL Shortener works, like how they extract the text from address bar and map it to correct URL, later redirect it. What programming language do they use? How do they maintain the history of the mapping? How do they ensure the uniqueness of the shortened url? How can a lay man unmap it without visiting the URL? Wiki Is Your Friend Basically, a website with a shorter name is used as a place holder, such as bit.ly. Then, bit.ly generates a key for the user to provide, which is randomly generated to not repeat. With 35 character options and 8 or so values, do the math. That's a lot

Using tinyurl.com in a .Net application … possible?

梦想与她 提交于 2019-11-28 22:52:11
问题 I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically create a tinyurl url. Is there a way to do this using code, specifically C# in ASP.NET? 回答1: You should probably add some error checking, etc, but this is probably the easiest way to do it: System.Uri address = new System.Uri("http://tinyurl.com/api-create.php?url=" + YOUR ADDRESS GOES HERE); System.Net.WebClient client = new System.Net.WebClient(); string

How does a URL Shortener work? [closed]

那年仲夏 提交于 2019-11-28 15:54:10
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I wonder how a URL Shortener works, like how they extract the text from address bar and map it to correct URL, later redirect it. What programming language do they use? How do they maintain the history of the

How to make unique short URL with Python?

隐身守侯 提交于 2019-11-28 03:12:20
How can I make unique URL in Python a la http://imgur.com/gM19g or http://tumblr.com/xzh3bi25y When using uuid from python I get a very large one. I want something shorter for URLs. FogleBird Edit : Here, I wrote a module for you. Use it. http://code.activestate.com/recipes/576918/ Counting up from 1 will guarantee short, unique URLS. /1, /2, /3 ... etc. Adding uppercase and lowercase letters to your alphabet will give URLs like those in your question. And you're just counting in base-62 instead of base-10. Now the only problem is that the URLs come consecutively. To fix that, read my answer

How to make unique short URL with Python?

青春壹個敷衍的年華 提交于 2019-11-27 05:05:47
问题 How can I make unique URL in Python a la http://imgur.com/gM19g or http://tumblr.com/xzh3bi25y When using uuid from python I get a very large one. I want something shorter for URLs. 回答1: Edit : Here, I wrote a module for you. Use it. http://code.activestate.com/recipes/576918/ Counting up from 1 will guarantee short, unique URLS. /1, /2, /3 ... etc. Adding uppercase and lowercase letters to your alphabet will give URLs like those in your question. And you're just counting in base-62 instead