I am using the ruby twitter gem and oauth to gain access to users twitter accounts. In my code, I have: unless @user.twitter_authd? oauth = Twitter::OAuth.new('token', 'secret') session[:twitter_request_token] = oauth.request_token.token session[:twitter_request_secret] = oauth.request_token.secret @twitter_auth_url = oauth.request_token.authorize_url end where token and secret have my actual toke
http://tech.lampetty.net/tech/index.php/archives/323 を参考にtwitterへアクセスするRailsアプリを作ってみた。目標としては、診断メーカー で結果を twitterに投稿する部分だけを実現する感じで。 アプリケーション登録 最初に twitterへ作ろうとしているアプリケーションを登録しておく。 http://dev.twitter.com/apps/new へアクセスして Consumer KeyとConsumer Secretを入手。これは後からRailsのソースに書き込む。 項目はこんな感じで アプリケーション名 : twitpost_nunocky (ユニークな名前を付ける必要がある) アプリケーションの説明 : OAuth study (適当に) アプリケーションのウェブサイトURL : http://www.examp
【追記】2010/5/12 生成後のsignatureをパーセントエンコードしていなかったミスを修正 signature生成に必要なパラメータは大文字、signature自体は小文字でURLエンコードする必要があったようだ。 ————————————————————————- C#でOAuth認証でTL取得とほとんど変わらない。 signatureを生成するとき、signature生成前にstatus(post本文)をURLエンコードしておかないとうまく認証されないみたい。 これでひとまずぼとすたやらシャナbotのOAuthへの移行へめどが立った。 おかしなところ指摘していただけると助かります。 class OAuthTwitter { const string consumer_key = "**********************"; const string consumer_s
目次1 はじめに2 用意するライブラリ3 OAuth認証のしくみ3.1 補足4 アプリケーションの登録4.1 現在の手順4.2 以前の手順5 実装5.1 OAuthToekn取得5.2 AccessTokenの取得5.3 TwitterAPIの呼び出し6 ライブラリ部6.1 修正等7 サンプルアプリケーション7.1 UI7.2 コード7.3 実行結果 はじめに 前回はベーシック認証を利用し、Twitterにつぶやきを投稿しましたが、今回はOAuth認証を利用してTwitterにつぶやきを投稿してみます。OAuth認証を用いると、Twittの下部にクライアントアプリ名が表示され、ちょっと見栄えもよくなります。また、APIの呼び出し回数の制限も緩和されるらしいです。 OAuth認証は、手間のかかる実装がいくつかあるため、今回はライブラリを使うことにします。 用意するライブラリ Google C
OAuth認証でTwitterにアクセスするコードをC#で書いてみた。OAuthBase.csを参考にした。今のところ認証を通過することぐらいしかできないのでそのうち機能を追加していきたい。 using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Configuration; using System.Text; using System.Web; using System.Net; using System.IO; namespace Twitter { class Auth { const string REQUEST_TOKEN_URL = "https://twitter.com/oauth/request_token"; const strin
Twitterの認証方式について Twitterの認証方式にはOAuthとBasic認証の二通りの仕組みがあります。 Twitter API Wiki / Authentication Basic認証はお手軽なので、世に存在するTwitter APIを利用する一般的なクライアントは、大抵がこちらの方法を使っているのではないかと思います。 ですが、実はこのBasic認証はセキュリティ上の理由から、将来的に非推奨になることが予告されています。 Twitter API Wiki / OAuth FAQ 既にTwitter API Wikiでは「今後作成するクライアントはOAuthを利用することを強く推奨する」と表明されており、それに応じてOAuthを使うクライアントも増えてきています。 …が、現状Basic認証を利用しているクライアントが既に大量に存在していることを考えると、今日明日でBasic
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く