This file contains hidden or 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
$(document).ready(function(){ | |
_ptq.push(["subscribe","1"]); | |
}); |
This file contains hidden or 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
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<div class="fb-comments" data-href="http://www.facebook.com/freedomofcreation?sk=app_152045414852131" data-num-posts="60" data-width="500"></div> |
This file contains hidden or 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
$(document).ready(function(){ | |
var show_pt_earning_map = function() { | |
$('.pt_earning_map').show(); | |
}; | |
PT.events.bind("authenticated",show_pt_earning_map); | |
}); |
This file contains hidden or 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
<img class="pt_earning_map" style="display:none;" src="https://static.punchtab.com/img/ribbon_earning_map.png"/> |
This file contains hidden or 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
class FoursquareUserToken(models.Model): | |
key = models.CharField(max_length=200,null=True) | |
secret = models.CharField(max_length=200) | |
status = models.CharField(max_length=10,default="ACT") | |
user = models.ForeignKey(User,null=True) | |
date_updated = models.DateTimeField(auto_now=True,null=True) | |
date_created = models.DateTimeField(auto_now_add=True) | |
def query(self): |
This file contains hidden or 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
class FacebookBackend: | |
def authenticate(self, token=None): | |
facebook_session,created = models.FacebookSession.objects.get_or_create(access_token=token,) | |
try: | |
profile = facebook_session.query('me') | |
except models.FacebookSessionError,e: | |
raise e |
This file contains hidden or 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
auth = FacebookBackend() | |
user = auth.authenticate(token=token) |
This file contains hidden or 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
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=295556227126830"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> | |
<div class="fb-comments" data-href="https://www.facebook.com/freedomofcreation?sk=app_152045414852131/1836" data-num-posts="2" data-width="500"></div> |
This file contains hidden or 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
function hello(data) { | |
alert("hello"); | |
} | |
var i=document.createElement("script"); | |
i.src=unescape("http://127.0.0.1:8000/api/v1/user?token="+PT.token+"&key="+PT.options.key+"&callback=hello&r="+Math.random()*11); | |
i.async=true; | |
i.charset="UTF-8"; | |
document.getElementsByTagName("head")[0].appendChild(i); |
This file contains hidden or 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
from django.core.mail import send_mail | |
def sales_form(request): | |
content = request.POST.get("content",None) | |
subject, from_email, to = 'subject', request.POST.get("from",None), ['[email protected]'] | |
send_mail(subject, content, from_email, to) |