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
# -*- coding: utf-8 -*- | |
require 'oauth' | |
require 'json' | |
require 'sinatra/base' | |
require 'net/http' | |
class NmaGw < Sinatra::Base | |
set :logging, true |
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
public class OAuthVerify extends Activity { | |
private static final String CONSUMER_KEY = ""; | |
private static final String CONSUMER_SECRET = ""; | |
private static final String CALLBACK_URL = "myoauthapp://oauthcallback/"; | |
private Context mContext; | |
private WebView mWebView; | |
private Twitter mTwitter; | |
private RequestToken mRequestToken; | |
private AccessToken mAccessToken; |
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 ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strconv" | |
) |
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
# mime decode for ruby 1.9 | |
def mime_decode( input, out_charset = 'utf-8' ) | |
while input.sub!(/(=\?[A-Za-z0-9_-]+\?[BQbq]\?[^\?]+\?=)(?:(?:\r\n)?[\s\t])+(=\?[A-Za-z0-9_-]+\?[BQbq]\?[^\?]+\?=)/, '\1\2') | |
end | |
begin | |
ret = input.sub!( /=\?([A-Za-z0-9_-]+)\?([BQbq])\?([^\?]+)\?=/ ) { | |
charset = $1 | |
enc = $2.upcase | |
word = $3 | |
word = word.unpack( { "B"=>"m*", "Q"=>"M*" }[enc] ).first |
OlderNewer