This file contains 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 | |
import threading | |
import Queue | |
import time | |
class Blarg(threading.Thread): | |
def run(self): | |
print time.time() | |
This file contains 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
{ | |
"meta":{ | |
"status":200, | |
"msg":"OK" | |
}, | |
"response":{ | |
"blog":{ | |
"title":"\/geek", | |
"posts":979, | |
"name":"codingjester", |
This file contains 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 | |
import urllib | |
import urlparse | |
import oauth2 as oauth | |
import json | |
consumer_key="consumer_key" | |
consumer_secret="consumer_secret" | |
access_token_url = 'https://www.tumblr.com/oauth/access_token' |
This file contains 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 urlparse | |
import oauth2 as oauth | |
consumer_key = 'consumer_key' | |
consumer_secret = 'consumer_secret' | |
request_token_url = 'https://www.tumblr.com/oauth/request_token' | |
access_token_url = 'https://www.tumblr.com/oauth/access_token' | |
authorize_url = 'https://www.tumblr.com/oauth/authorize' |
This file contains 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
{ | |
"meta":{ | |
"status":200, | |
"msg":"OK" | |
}, | |
"response":{ | |
"blog":{ | |
"title":"\/geek", | |
"posts":1160, | |
"name":"codingjester", |
This file contains 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
$.ajax( | |
'http://api.tumblr.com/v2/blog/codingjester.tumblr.com/posts?api_key=<your_key>', | |
{ | |
dataType: 'jsonp', | |
success: function (d) { | |
console.log(d); // On success log the data to the console | |
}, | |
} | |
); |
This file contains 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
<?php | |
function get_posts($url, $params) { | |
$params = http_build_query($params); | |
$client = curl_init($url . "?" . $params); | |
curl_setopt($client, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($client, CURLOPT_FAILONERROR, 1); | |
try { | |
$content = curl_exec($client); | |
} catch (Exception $e) { |
This file contains 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 json | |
import stat | |
DEBUG = True | |
def debug_cache_data(fn): | |
def cache_data(*args): | |
if DEBUG and os.path.exists(fn.__name__): | |
return json.loads(open(fn.__name__, 'r').read()) | |
else: |
This file contains 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
jQuery.getJSON( | |
'http://api.tumblr.com/v2/blog/codingjester.tumblr.com/posts?api_key=<api_key>&jsonp=?', | |
function(d) { | |
console.log(d); | |
}); |
This file contains 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
require 'mechanize' | |
a = Mechanize.new | |
a.get('https://us.etrade.com/home') do |page| | |
mypage = page.form_with(:action => '/login.fcc') do |f| | |
f.USER = ARGV[0] | |
f.PASSWORD = ARGV[1] | |
end.click_button |