Is it possible to call the bit.ly API with VB.net?
-
09-10-2019 - |
Question
How do I reach the bit.ly
API with VB.net 2010—is it even possible? How?
Solution
I was interested myself to see how it works, this might get you started:
Option Infer On
Imports System.Net
Imports System.Web
Module Module1
Sub Main()
Dim wc = New WebClient()
Dim login = "your_login"
Dim apiKey = "your_apikey"
Dim longUrl = HttpUtility.UrlEncode("http://stackoverflow.com/questions/4427104/vb-is-there-any-possibility-to-call-the-bit-ly-api")
Dim request = String.Format("http://api.bit.ly/v3/shorten?login={0}&apiKey={1}&longUrl={2}&format=txt", login, apiKey, longUrl)
Dim result = wc.DownloadString(request)
End Sub
End Module
The API documentation can be found here: http://code.google.com/p/bitly-api/wiki/ApiDocumentation
OTHER TIPS
I found 2 examples where they use bit.ly to shorten url's. Is this what you're looking for?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow