Skip to content

Instantly share code, notes, and snippets.

View boertel's full-sized avatar

Benjamin Oertel boertel

View GitHub Profile
@boertel
boertel / gist:2589651
Created May 3, 2012 21:26
Share on facebook
// call the Facebook API
message = {
name: $(this).attr("data-name"),
link: $(this).attr("data-url"),
caption: $(this).attr("data-caption"),
description: $(this).attr("data-description"),
picture: "http://static.punchtab.com/ebay/images/ebay-sharing-image.png",
message: "What's in my mind?"
}
FB.api("me/feed", message, function (response) {
@boertel
boertel / gist:2898572
Created June 8, 2012 23:06
Mini Giveaway Widget
<div style="width: 250px;font-family: 'Open Sans', sans-serif; font-size: 14px; border: 1px solid #DDD; border-radius: 5px; margin: 0 auto;">
<div style="font-weight: bold;">
<div style="color: #fff; overflow: hidden; clear: both; border-top-left-radius: 5px; border-top-right-radius: 5px;background: url(//static.punchtab.com/nd/images/logo-18.png) no-repeat;background-position: 10px 0;background-color: #434343;padding: 5px;">
<div style="text-align: center; float: left; width: 100%;">
My Awesome Giveaway
</div>
</div>
</div>
<div style="clear: both; overflow: hidden; position: relative; height: 160px;">
<div style="float: left; width: 100px; position: absolute;">
@boertel
boertel / gist:3189702
Created July 27, 2012 18:41
Invisible mode for specific pages
(function() {
var pages = [];
var noLoad = false;
for (var i = 0; i < pages.length; i++) {
if (document.location.pathname === pages[i]) {
noLoad = true;
break;
}
}
if (noLoad) {
@boertel
boertel / gist:3738999
Created September 17, 2012 18:43
Open the catalog with pt_open=catalog in the URL.
<script type="text/javascript" charset="utf-8">
window.ptReady = window.ptReady || [];
window.ptReady.push(function () {
var args = PT.serializer.qsDecode(document.location.search);
if (args.pt_open !== undefined) {
PT.event.trigger('mast.open', {panel: args.pt_open});
}
});
</script>
@boertel
boertel / gist:3796586
Created September 27, 2012 21:31
PunchTab snippet
var _ptq = _ptq || [];
var _punchtab_settings = {
key: "2fed406f5ea11a79372eabadfe03aec3",
bar: {
text:{
loggedOut:"Look for <img src='http://rewards.alexiafoods.com/wp-content/uploads/2012/10/punchtab_share_icon.png'/> to collect more points",
},
tweet: {
text: "PREFIX " + document.title
},
@boertel
boertel / gist:4323449
Created December 17, 2012 23:31
Follow Action
window.ptReady.push(function () {
PT.event.bind('twitter.follow', function (message) {
var screen_name = message.screen_name.toLowerCase();
if (screen_name === "<YOUR TWITTER HANDLER>".toLowerCase()) {
_ptq.push(['follow', {points: 100}]);
}
});
});
@boertel
boertel / invite.html
Created December 17, 2012 23:38
Invite Action
<input type='text' name='invite'>
@boertel
boertel / gist:4558631
Last active December 11, 2015 06:19
Customize tweet message
var _punchtab_settings = {
key: "<YOUR KEY>",
bar: {
//url: "<URL TO LIKE/TWEET/+1",
tweet: {
text: "<YOUR TEXT>"
}
}
};
@boertel
boertel / connect-button.html
Created May 23, 2013 18:43
PunchTab connect button
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<button id="connect-button">Connect</button>
@boertel
boertel / referral.js
Last active December 18, 2015 11:39
Get referral link
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);