Skip to content

Instantly share code, notes, and snippets.

@sketchthat
Last active November 28, 2017 19:24
Show Gist options
  • Select an option

  • Save sketchthat/ae60aece1c5c7e7932e65c2519518dd8 to your computer and use it in GitHub Desktop.

Select an option

Save sketchthat/ae60aece1c5c7e7932e65c2519518dd8 to your computer and use it in GitHub Desktop.

Revisions

  1. sketchthat renamed this gist Sep 6, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. sketchthat renamed this gist Sep 6, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. sketchthat created this gist Sep 6, 2017.
    15 changes: 15 additions & 0 deletions jQuery bit.ly Request
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    // Generate Access Token
    // https://bitly.com/a/oauth_apps

    var shortenUrl = function(accessToken, longUrl) {
    $.getJSON('https://api-ssl.bitly.com/v3/shorten', {
    access_token: accessToken,
    longUrl: longUrl
    })
    .success(function(resp) {
    console.log('URL: ', resp.data.url);
    })
    .error(function(err) {
    console.error(err);
    });
    };