Skip to content

Instantly share code, notes, and snippets.

View codingjester's full-sized avatar
🙊
Focusing

codingjester

🙊
Focusing
View GitHub Profile
require 'mail'
load 'mrbananagrabber.rb'
module Mail
def self.to_hash
puts "ok"
end
end
x = Mail.new STDIN.read
function log_me(data){
console.log(data);
}
jQuery.ajax({url: "http://api.tumblr.com/v2/blog/scipsy.tumblr.com/info?api_key={YOUR-KEY}&jsonp=log_me", dataType: "jsonp"});
@codingjester
codingjester / oauth
Created October 12, 2011 00:11
Follow/Unfollow example OAuth for Tumblr API
#!/usr/bin/env python
import oauth2 as oauth
import urlparse
import urllib
consumer_key = '<your-key-here>'
consumer_secret = '<your-secret-key-here>'
request_token_url = 'http://www.tumblr.com/oauth/request_token'
@codingjester
codingjester / xauth.py
Created October 19, 2011 15:59
Using XAuth for Tumblr
#!/usr/bin/env python
import urllib
import urlparse
import oauth2 as oauth
@codingjester
codingjester / tumblrv2api.py
Created November 23, 2011 21:22
Working version of Photo Uploads for Tumblr API V2
import urllib,hmac,time,hashlib,base64,httplib,sys,json,urlparse
## This is just a simple example that is self contained.
## You will need to modified it to make it work
##
## creds - need to be filled out
## blognmae - needs to be defined
##
## reads in image files from the command line and posts to your blog
##
@codingjester
codingjester / duckduckgo.rb
Created January 14, 2012 19:28
DuckDuckGo Ruby API
require 'net/http'; require 'json'; JSON.parse(Net::HTTP.get(URI("http://duckduckgo.com/?q=#{query}&o=json")))
@codingjester
codingjester / upload.php
Created January 20, 2012 22:09
Working PHP example of uploading a photo with V2 api
<?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) {
@codingjester
codingjester / simpletumblr.py
Created March 31, 2012 01:03
Simple Python Gist for the Tumblr API
#!/usr/bin/env python
import oauth2 as oauth
consumer = oauth.Consumer('consumer_key','consumer_secret')
token = oauth.Token('oauth_key', 'oauth_secret')
client = oauth.Client(consumer, token)
print client.request("http://api.tumblr.com/v2/user/info", "POST")
@codingjester
codingjester / oauth_tumblr.py
Created April 3, 2012 23:33
OAuth Tumblr Getting Access Tokens
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'
@codingjester
codingjester / multiplication.js
Created April 19, 2012 21:53
Javascript for Renee
function multiply(a,b) {
return a * b;
}
data = [1,2,3];
for(var d in data) {
answer = multiply(data[d], 2);
console.log(answer);
}