bitlyAPI.ahkVERSION:
v0.1.3DESCRIPTION
A wrapper/library for the bit.ly API: http://bit.ly/apidocs
FEATURES:bit.ly allows users to shorten, share, and track links (URLs). Reducing the URL length makes sharing easier. bit.ly can be accessed through our website, bookmarklets and a robust and open API. bit.ly is also integrated into several popular third-party tools such as Tweetdeck.
• Proxy Support
• Shorten long URLs
• Shorten multiple long URLs with one API call
• Store shortened URLs in user history
• Expand bit.ly URLs
• Get stats of bit.ly URLs
• Get a list of bit.ly API error codes
• Return specified nodes of fetched XML dataFUNCTIONS:
• bitly_shorten() - Given a long url, returns a shorter one.
• bitly_expand() - Given a long url, returns a shorter one.
• bitly_info() - Given a bit.ly url or hash, return information about that page, such as the long source url, ...
• bitly_stats() - Given a bit.ly url or hash, return traffic and referrer data.
• bitly_errors() - Get a list of bit.ly API error codes.
• bitly_recent() - Get a list of user bit.ly URLsREQUIREMENTS:
• httpQuery
Note: httpQuery is included in the bitlyAPI.ahkDIRECTIONS:
1. Sign up for an account with bit.ly.
2. Grab the long API key from the account page and enter it in the bit.ly User Info section along with the API login
3. Optional - Enter in proxy user info if behind a proxy
Global Variables used for bit.ly account and/or proxy:
• login
• apiKey
• Proxy_UserName
• Proxy_Password
• Proxy_Address
• Proxy_Port
Note: Uses default login of bitlyapidemo if no login is specifiedEXAMPLES:
Example I: Get the bit.ly short URL and save it to the user history.
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_shorten("http://cnn.com",1) MsgBox, % valExample II: Get the long URL from a bit.ly URL.
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_expand("http://bit.ly/BEMuf") MsgBox, % valExample III: Get the small thumbnail url from the bit.ly URL
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_info("http://bit.ly/BEMuf","thumbnail/small") MsgBox, % valExample IV: Get the list of referrers of the bit.ly URL
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_stats("http://bit.ly/BEMuf","referrers") MsgBox, % valExample V: Get the list of API errorsMessages.
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_errors("errorMessage") MsgBox, % val
Example VI: Get the entire recent.rss XML data for the user bitlyapidemo.
#Include bitlyAPI.ahk login := "bitlyapidemo" apiKey := "R_0da49e0a9118ff35f52f629d2d71bf07" val := bitly_recent("bitlyapidemo") MsgBox, % valNote: bitly_recent() does not return the list of referrers parsed.DOCUMENTATION
• <!-- m -->https://ahknet.autoh...ron43/#bitlyAPI<!-- m -->bitlyAPI v0.1.3DOWNLOADTODO:
[ ] Error checks[ ] j.mp support
[ ] support for links without <!-- m -->http://www<!-- m -->. prefix?
CHANGELOG:
v0.1.3 - 9/29/09
• Handle special character in bitly_shorten() - #
v0.1.2 - 6/21/09
• Added keyword function to bitly_shorten() function
• Added getURL() support funtion
• Replace "&" with "&" in returned bitly_expand() url
v0.1.1 - 5/29/09
• Handle special characters in bitly_shorten() URL - &?+