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.paginator import EmptyPage, PageNotAnInteger, Paginator | |
# First we create a little helper function, becase we will potentially have many PaginatedTypes | |
# and we will potentially want to turn many querysets into paginated results: | |
def get_paginator(qs, page_size, page, paginated_type, **kwargs): | |
p = Paginator(qs, page_size) | |
try: | |
page_obj = p.page(page) | |
except PageNotAnInteger: |
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
{ | |
"sent": [ | |
{ | |
"id": 2, | |
"profile": { | |
"nickname": "Foo03 Foo04 Swinger", | |
"picture": "https://assets.trome.pe/files/ec_article_multimedia_gallery/uploads/2018/04/17/5ad609d27c1a7.jpeg" | |
} | |
}, | |
{ |
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
{ | |
"single": { | |
"profiletype": 0, | |
"nickname": "foo10", | |
"picture": "https://foo34.jpg", | |
"country": "México", | |
"spot": "Aguascalientes", | |
"city": "Aguascalientes", | |
"country_born": "México", | |
"give_oral": "2", |
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
{ | |
"single": null, | |
"couple": { | |
"id_person_one": { | |
"profiletype": 0, | |
"nickname": "foo08", | |
"picture": "https://foo34.jpg", | |
"country": "México", | |
"spot": "Aguascalientes", | |
"city": "Aguascalientes", |
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
{ | |
"object_type": "profile", | |
"friends": false, | |
"friendship_pending_request": true, | |
"already_verified": false, | |
"photos": [], | |
"verifications": [], | |
"friendships": [], | |
"profile_data": { | |
"id": 7, |
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
{ | |
"object_type": "profile", | |
"friends": true, | |
"friendship_pending_request": false, | |
"already_verified": false, | |
"photos": [ | |
{ | |
"url": "https://www.omniitworld.com/img/team5.jpg" | |
} | |
], |
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
import os | |
import base64 | |
import flask | |
import urllib.parse | |
import requests | |
app = flask.Flask(__name__) | |
APP_ID = "ID" | |
APP_SECRET = "SECRET" |
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
import sys, urllib, urllib2, cookielib | |
class FacebookLogin(object): | |
def __init__(self,user,passw): | |
self.user=user | |
self.passw=passw | |
self.browser = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookielib.CookieJar())) | |
self.browser.addheaders=[('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0')] | |
urllib2.install_opener(self.browser) |
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
#!/home/drspock/scripts/FBInvite/bin/python | |
import argparse | |
import requests | |
import pyquery | |
def login(session, email, password): | |
''' | |
Attempt to login to Facebook. Returns user ID, xs token and |
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.contrib.auth import get_user_model | |
from rest_framework import status, serializers | |
from rest_framework.decorators import api_view | |
from rest_framework.response import Response | |
class UserSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = get_user_model() |