Last active
December 18, 2015 11:39
-
-
Save boertel/5776843 to your computer and use it in GitHub Desktop.
Get referral link
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
var _ptq = _ptq || []; | |
var _punchtab_settings = { | |
key: "<YOUR KEY>", | |
display: "tab" | |
}; | |
(function() { | |
var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true; | |
pt.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.punchtab.com/js/pt.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(pt, s); | |
})(); | |
window.ptReady = window.ptReady || []; | |
window.ptReady.push(function () { | |
PT.referral.getUrl(document.location.href, function (response) { | |
console.log(response); // contains response.longUrl (punchtab.com link) and response.shortUrl (ptab.it link) | |
}, true); // ask for short url | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment