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
| {'query': {'normalized': [{'to': 'Stone Cold Steve Austin', 'from': 'Stone_Cold_Steve_Austin'}], 'pages': {'356167': {'lastrevid': 498254288, 'pageid': 356167, 'title': 'Stone Cold Steve Austin', 'starttimestamp': '2012-06-18T23:45:37Z', 'counter': '', 'edittoken': '+\\', 'length': 98448, 'touched': '2012-06-18T23:07:58Z', 'ns': 0, 'revisions': [{'comment': "Reverted 2 edits by [[Special:Contributions/82.12.76.225|82.12.76.225]] ([[User talk:82.12.76.225|talk]]): Linked article on sister project doesn't exist. ([[WP:TW|TW]])", 'timestamp': '2012-06-18T23:07:58Z', 'user': 'Suriel1981', 'revid': 498254288, 'parentid': 498220891}]}}}} |
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
| { | |
| "keys": ["shift+super+r"], | |
| "command": "show_panel", "args": {"panel": "replace"} | |
| } |
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
| params = { | |
| 'message': 'Hi dude.', | |
| 'source': open('filepath.jpg', 'rb') | |
| } | |
| files = {} | |
| for k, v in params.items(): | |
| if isinstance(v, file): | |
| files[k] = v | |
| params.pop(k) |
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
| except (facebook.GraphAPIError, DrundWorkerError, urllib2.HTTPError), e: | |
| error = 'Unable to retrieve feed.' | |
| if isinstance(e, urllib2.HTTPError): | |
| try: | |
| fb_error = json.loads(e.read()) | |
| error = fb_error['error']['message'] | |
| if fb_error['error']['type'] == 'OAuthException': | |
| error += ' Please unauthorize Facebook via Settings > Manage Applications and then authenticate again.' | |
| except ValueError: |
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'} |
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 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
| 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
| 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' |