Skip to content

Instantly share code, notes, and snippets.

@tatat
tatat / twimg.rb
Created February 15, 2012 20:44
Twitterで OAuth + SSL + まるちぱぁと してみた時の
require 'mime/types'
require 'net/https'
require 'net/http/post/multipart' # sudo gem install multipart-post
require 'oauth' # sudo gem install oauth
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
(function(g, undefined) {
var __index_of = !Array.prototype.indexOf ? function (array, search) {
var len = array.length
, from = Number(arguments[1]) || 0;
from = from < 0 ? Math.ceil(from) : Math.floor(from);
if (from < 0) from += len;