Skip to content

Instantly share code, notes, and snippets.

@reportbase
Created November 10, 2015 00:42
Show Gist options
  • Save reportbase/c828f25a92afdf452ac8 to your computer and use it in GitHub Desktop.
Save reportbase/c828f25a92afdf452ac8 to your computer and use it in GitHub Desktop.
bitly
[0, clr.SUBHEADER, "Bitly User Info", function()
{
var http = new XMLHttpRequest();
http.open("GET", "https://api-ssl.bitly.com/v3/user/info?access_token=" + global.bitfly_access_token);
http.responseType = "json";
http.onreadystatechange = function(){if (this.readyState == this.DONE) console.log(this.response);};
http.send();
}],
[0, clr.SUBHEADER, "Bitly Link Info", function()
{
var http = new XMLHttpRequest();
http.open("GET", "https://api-ssl.bitly.com/v3/link/info?access_token=" + global.bitfly_access_token + "&link=" + encodeURIComponent("http://bit.ly/reportbase") );
http.responseType = "json";
http.onreadystatechange = function(){if (this.readyState == this.DONE) console.log(this.response);};
http.send();
}],
[0, clr.SUBHEADER, "Bitly Link History", function()
{
var http = new XMLHttpRequest();
http.open("GET", "https://api-ssl.bitly.com/v3/user/link_history?access_token=" + global.bitfly_access_token);
http.responseType = "json";
http.onreadystatechange = function(){if (this.readyState == this.DONE) console.log(this.response);};
http.send();
}],
[0, clr.SUBHEADER, "Bitly Login", function()
{
window.open("https://bitly.com/oauth/authorize?client_id=" + global.bitly_client_id +
"&redirect_uri=http://bull.report/bitly.authorization","_self");
}],
[0, clr.SUBHEADER, "Bitly Shorten", function()
{
var http = new XMLHttpRequest();
http.open("GET", "https://api-ssl.bitly.com/v3/shorten?access_token=" + global.bitfly_access_token + "&longUrl=" + encodeURIComponent(get_application_url()));
http.responseType = "json";
http.onreadystatechange = function(){if (this.readyState == this.DONE) window.open("https://app.bitly.com","_self");};
http.send();
}],
@reportbase
Copy link
Author

bitly_client_id: "8c4885b2f1ab5ff5086bb69cdbf7a1ec3ff34a4b",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment