Last active
January 3, 2016 09:19
-
-
Save bosconian-dynamics/8441863 to your computer and use it in GitHub Desktop.
JavaScript function to expand virtually any shortened/masked URL using the LongURL.com API v2. If a callback is passed the request will execute asynchronously, otherwise the function will block until a response has been received. Uses the "longURLAPICall()" function from http://gist.github.com/KuroTsuto/8447974
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expandShortenedURL = function( str_shortenedURL, fn_callback ) { | |
if( str_shortenedURL.indexOf( "http://" ) < 0 ) | |
str_shortenedURL = "http://" + str_shortenedURL; | |
return longURLAPICall( "expand", { title: 1, url: str_shortenedURL }, fn_callback ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment