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 | |
#Requires PHP 5.3.0 | |
define("CONSUMER_KEY", "consumer_key"); | |
define("CONSUMER_SECRET", "consumer_secret"); | |
define("OAUTH_TOKEN", "access_token"); | |
define("OAUTH_SECRET", "access_secret"); | |
function oauth_gen($method, $url, $iparams, &$headers) { |
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
#!/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 = 'http://www.tumblr.com/oauth/request_token' | |
access_token_url = 'http://www.tumblr.com/oauth/access_token' | |
authorize_url = 'http://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
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
package main | |
import ( | |
"net/http" | |
"github.com/gorilla/mux" | |
) | |
func main() { | |
r := mux.NewRouter() |
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 | |
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 |
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
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: |
NewerOlder