In some web applications need to create short links to avoid the classic http://www.tupagina.com/tipo1=32&variable2=32532 and instead get something like http://tinyurl.com/yk6xo6j, maybe not so easy remember but less complicated than before, so that we will use TinyURL API and classic ASP.
The function that we use is: function
And how to call it so:asp_short_url (strURL) Dim
OXML, strTinyUrl
strTinyUrl = "http://tinyurl.com/api-create.php?url =" & strURL
September OXML = Server.CreateObject ("Msxml2.ServerXMLHTTP.3.0)
oXml.Open" GET ", strTinyUrl, false null oXml.Send
asp_short_url = OXml.responseText
September OXML = nothing End Function
Response.Write (asp_short_url (http://www.tupagina.com/tipo1=32&variable2=32532 "))Where the bold is the only thing that must change, is quite simple and useful ... or I hope so.
0 comments:
Post a Comment