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
{'comment':'testing Python-Linkedin', | |
'share':{'visibility': | |
{'code':'anyone'} | |
} | |
} |
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
#!/usr/bin/env python | |
''' | |
This script originated at http://pastebin.com/zK3ZYaS8 | |
I've modified it... just a `little` bit. ;P | |
I only reached to page 161 and Twitter stopped giving me | |
tweets. :( Let me know if you get further! | |
- Mike Helmick |
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
<!doctype html> | |
<head> | |
</head> | |
<body> | |
</body> | |
</html> |
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
def get_profile(self): | |
""" | |
Returns site-specific profile for this user. Raises | |
SiteProfileNotAvailable if this site does not allow profiles. | |
""" | |
if not hasattr(self, '_profile_cache'): | |
from django.conf import settings | |
if not getattr(settings, 'AUTH_PROFILE_MODULE', False): | |
raise SiteProfileNotAvailable('You need to set AUTH_PROFILE_MO' |
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
#requests-oauth header produces: | |
{ | |
'Authorization': 'OAuth realm="", oauth_nonce="50997118", oauth_timestamp="1331135338", oauth_consumer_key="********", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="********", oauth_signature="IT1qsDRpc0wHXxo0q9IscLSpGaU%3D"' | |
} | |
#faux_req.to_header() produces: | |
{ | |
'Authorization': u 'OAuth realm="", oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D", oauth_nonce="74348031731097571737250753271922149182231", oauth_timestamp="1331078125", oauth_consumer_key="********", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="********", oauth_signature="jv7TI4Xg3VK3x0IqrpRpL1u10z0%3D"' | |
} |
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
def get_authentication_tokens(self): | |
""" | |
get_auth_url(self) | |
Returns an authorization URL for a user to hit. | |
""" | |
callback_url = self.callback_url or 'oob' | |
request_args = {} | |
method = 'get' |
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.path | |
import ssl | |
import sys | |
import urlparse | |
import urllib | |
def check_ssl(hostname, port=443): | |
'''Check that an SSL certificate is valid |
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 httplib | |
import ssl | |
import socket | |
import sys | |
import urllib2 | |
class HTTPSConnectionV3(httplib.HTTPSConnection): | |
def __init__(self, *args, **kwargs): | |
httplib.HTTPSConnection.__init__(self, *args, **kwargs) |
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
<span id=\"video_player_3411854767\">[<a href=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">Flash 10</a> is required to watch video.]</span><script type=\"text/javascript\">renderVideo(\"video_player_3411854767\",'http://api.tumblr.com/video_file/3411854767/tumblr_lgxv3ghjVH1qfkzra',500,281,'poster=http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lgxv3ghjVH1qfkzra_r1_frame1.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lgxv3ghjVH1qfkzra_r1_frame2.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lgxv3ghjVH1qfkzra_r1_frame3.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lgxv3ghjVH1qfkzra_r1_frame4.jpg,http%3A%2F%2Fmedia.tumblr.com%2Ftumblr_lgxv3ghjVH1qfkzra_r1_frame5.jpg')</script> |
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 requests | |
from requests.auth import OAuth1 | |
url = 'https://upload.twitter.com/1/statuses/update_with_media.json' | |
auth = OAuth1(app_key, app_secret, | |
oauth_token, oauth_secret, | |
signature_type='auth_header') | |
data = {'status': 'Testing status with images'} |