Create TinyURL with Classic ASP (VBScript)
Posted on 14.05.09 11:27:06 by Ariel G. Saputra in Classic ASP, Tutorials
TinyURL has been around for years, which enabled you to shortenize your very long url addresses, It has an API also to programmaticaly create your own shortenized url on the fly, and here is a sample of TinyURL API implementation with Classic ASP (VBScript).
Classic ASP (VBScript) TinyURL Function
function asp_short_url(strUrl)
Dim oXml,strTinyUrl,strReturnVal
strTinyUrl = "http://tinyurl.com/api-create.php?url=" & strUrl
set oXml = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
oXml.Open "GET", strTinyUrl, false
oXml.Send
strReturnVal = oXml.responseText
Set oXml = nothing
asp_short_url = strReturnVal
End Function
usage Sample
Response.Write (asp_short_url("http://asp.web.id/get-flickr-photos-with-classic-asp-flickr-api.html"))



0 Comments For This Post
2 Trackbacks For This Post
Update Twitter Status with Classic ASP (VBScript) | ASP Blog Says:
[...] use our prior Classic ASP TinyURL function to shorten the content permalink and send it to [...]
Short URL with Classic ASP | ASP Blog Says:
[...] Shorten URL is common in twitter to shortenize url because of characters limitation, I have posted sample of creating short url via tinyURL, here i have encapsulated the codes in a class and adding more shorten url providers (is.gd & [...]