Skip to content

Instantly share code, notes, and snippets.

View mehdimehdi's full-sized avatar

Mehdi Ait Oufkir mehdimehdi

View GitHub Profile
import urllib
import urllib2
from tweepy import oauth
CONSUMER_KEY = '50B4YwaUeSQvyCaFeI3TRg'
CONSUMER_SECRET = 'XXXX'
RESOURCE_URL = 'https://punchtab.uservoice.com/api/v1/tickets.json'
# Setup 2 legged OAuth consumer based on our admin "credentials"
consumer = oauth.OAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET)
@mehdimehdi
mehdimehdi / gist:2347465
Created April 9, 2012 23:55
Snippet for ebay motors
<!-- this is the usual PunchTab Snippet -->
<script type="text/javascript" charset="utf-8">
var _ptq = _ptq || [];
var _punchtab_settings = {
key: "YOUR KEY",
display: "inline",
notification: false,
earningmap: false
};
(function() {
@mehdimehdi
mehdimehdi / gist:2356777
Created April 11, 2012 04:04
Reward enable linked share button
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
@mehdimehdi
mehdimehdi / gist:2656418
Last active October 4, 2015 14:57
PollDaddy example
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
import urllib
import urllib2
import simplejson
import re
import time
from urlparse import urlparse
RESOURCE_URL = 'https://graph.facebook.com/'
params = {'access_token':'SOMEHTING'}
@mehdimehdi
mehdimehdi / gist:3094447
Created July 11, 2012 23:34 — forked from boertel/gist:2898572
Mini Giveaway Widget
<div class="textwidget"><div style="width: 180px;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%;">
Enter to win a FREE Breville Juicer!!!
</div>
</div>
</div>
<div style="clear: both; overflow: hidden; position: relative; height: 270px;">
<div style="margin-top:10px;">
@mehdimehdi
mehdimehdi / gist:3145971
Created July 19, 2012 18:53
Integrate Google Analytics with PunchTab
window.ptReady = window.ptReady || [];
var _gaq = _gaq || [];
//this is instantiated when PT is loaded.
window.ptReady.push(function () {
//add the custom variable for the members so you can segment them.
PT.event.bind("user.connected", function (response) {
@mehdimehdi
mehdimehdi / gist:3288151
Created August 7, 2012 18:37
custom punchtab settings (snippet)
var _punchtab_settings = {
key: "<YOUR KEY>",
display: "tab",
activity : {like:200,tweet:200,plusone:200},
position: {x:"left", y:"bottom"},
unbrand: true
};
"name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-13T12:32:43.570Z")
"name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-13T12:32:17.977Z")
"name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-12T10:17:37.486Z")
"name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-12T10:17:19.734Z")
"name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-11T11:01:48.138Z")
"name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-11T11:01:31.839Z")
"name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-10T10:20:25.534Z")
"name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-10T10:20:08.958Z")
"name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-09T11:49:04.067Z")
"name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-09T11:48:40.439Z")
{ "name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-14T11:45:48.049Z") }
{ "name" : "like", "points" : 100, "date_created" : ISODate("2012-08-14T11:41:43.797Z") }
{ "name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-14T11:41:21.782Z") }
{ "name" : "like", "points" : 100, "date_created" : ISODate("2012-08-13T11:15:38.010Z") }
{ "name" : "like", "points" : 100, "date_created" : ISODate("2012-08-13T11:15:38.009Z") }
{ "name" : "like", "points" : 100, "date_created" : ISODate("2012-08-13T11:15:38.007Z") }
{ "name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-13T11:15:22.821Z") }
{ "name" : "visit", "points" : 100, "date_created" : ISODate("2012-08-13T11:14:32.977Z") }
{ "name" : "like", "points" : 100, "date_created" : ISODate("2012-08-12T11:00:53.993Z") }
{ "name" : "tweet", "points" : 100, "date_created" : ISODate("2012-08-12T11:00:45.127Z") }