Enviar pesquisa
Carregar
Wtidev 0430 tmoktia
•
0 gostou
•
547 visualizações
Tomohiko Okita
Seguir
過去の遺産
Leia menos
Leia mais
Vista de apresentação de diapositivos
Denunciar
Compartilhar
Vista de apresentação de diapositivos
Denunciar
Compartilhar
1 de 26
Baixar agora
Baixar para ler offline
Recomendados
Vagrant chef
Vagrant chef
Hiroki Nigorinuma
Git learn
Git learn
Hiroki Nigorinuma
Tensorflow pythonapi upgrade(~0.12→1.0~)
Tensorflow pythonapi upgrade(~0.12→1.0~)
Naonori Nagano
Cocos2dx 8hour
Cocos2dx 8hour
Tomohiko Okita
FACULTY AND STAFF DEVELOPMENT
FACULTY AND STAFF DEVELOPMENT
djhune
Bba.nshm durgapur 2012
Bba.nshm durgapur 2012
NCMT Durgapur
第3回yidev coding guideline読み
第3回yidev coding guideline読み
Tomohiko Okita
Hurdles for the india a case study
Hurdles for the india a case study
DGMS, Ministry of Labour & Employment, New Delhi
Recomendados
Vagrant chef
Vagrant chef
Hiroki Nigorinuma
Git learn
Git learn
Hiroki Nigorinuma
Tensorflow pythonapi upgrade(~0.12→1.0~)
Tensorflow pythonapi upgrade(~0.12→1.0~)
Naonori Nagano
Cocos2dx 8hour
Cocos2dx 8hour
Tomohiko Okita
FACULTY AND STAFF DEVELOPMENT
FACULTY AND STAFF DEVELOPMENT
djhune
Bba.nshm durgapur 2012
Bba.nshm durgapur 2012
NCMT Durgapur
第3回yidev coding guideline読み
第3回yidev coding guideline読み
Tomohiko Okita
Hurdles for the india a case study
Hurdles for the india a case study
DGMS, Ministry of Labour & Employment, New Delhi
Pillar design
Pillar design
DGMS, Ministry of Labour & Employment, New Delhi
Energy management
Energy management
DGMS, Ministry of Labour & Employment, New Delhi
I phone勉強会 2010_03_06_gameloop
I phone勉強会 2010_03_06_gameloop
Tomohiko Okita
Stonehaven Energy Resources
Stonehaven Energy Resources
dsangster
Saitama beginner tips50
Saitama beginner tips50
Tomohiko Okita
Wtidev0227 tmokita
Wtidev0227 tmokita
Tomohiko Okita
Marteokiko
Marteokiko
francisco.67.09.15
Team building a case study
Team building a case study
DGMS, Ministry of Labour & Employment, New Delhi
Design of super elevation :- A case study
Design of super elevation :- A case study
DGMS, Ministry of Labour & Employment, New Delhi
Extraction of developed pillars by opencast mine: acase study
Extraction of developed pillars by opencast mine: acase study
DGMS, Ministry of Labour & Employment, New Delhi
Highwall mining – a new approach in india
Highwall mining – a new approach in india
DGMS, Ministry of Labour & Employment, New Delhi
New approch towards support desugn
New approch towards support desugn
DGMS, Ministry of Labour & Employment, New Delhi
Pillar design
Pillar design
DGMS, Ministry of Labour & Employment, New Delhi
Mais conteúdo relacionado
Destaque
Pillar design
Pillar design
DGMS, Ministry of Labour & Employment, New Delhi
Energy management
Energy management
DGMS, Ministry of Labour & Employment, New Delhi
I phone勉強会 2010_03_06_gameloop
I phone勉強会 2010_03_06_gameloop
Tomohiko Okita
Stonehaven Energy Resources
Stonehaven Energy Resources
dsangster
Saitama beginner tips50
Saitama beginner tips50
Tomohiko Okita
Wtidev0227 tmokita
Wtidev0227 tmokita
Tomohiko Okita
Marteokiko
Marteokiko
francisco.67.09.15
Team building a case study
Team building a case study
DGMS, Ministry of Labour & Employment, New Delhi
Design of super elevation :- A case study
Design of super elevation :- A case study
DGMS, Ministry of Labour & Employment, New Delhi
Extraction of developed pillars by opencast mine: acase study
Extraction of developed pillars by opencast mine: acase study
DGMS, Ministry of Labour & Employment, New Delhi
Highwall mining – a new approach in india
Highwall mining – a new approach in india
DGMS, Ministry of Labour & Employment, New Delhi
New approch towards support desugn
New approch towards support desugn
DGMS, Ministry of Labour & Employment, New Delhi
Pillar design
Pillar design
DGMS, Ministry of Labour & Employment, New Delhi
Destaque
(13)
Pillar design
Pillar design
Energy management
Energy management
I phone勉強会 2010_03_06_gameloop
I phone勉強会 2010_03_06_gameloop
Stonehaven Energy Resources
Stonehaven Energy Resources
Saitama beginner tips50
Saitama beginner tips50
Wtidev0227 tmokita
Wtidev0227 tmokita
Marteokiko
Marteokiko
Team building a case study
Team building a case study
Design of super elevation :- A case study
Design of super elevation :- A case study
Extraction of developed pillars by opencast mine: acase study
Extraction of developed pillars by opencast mine: acase study
Highwall mining – a new approach in india
Highwall mining – a new approach in india
New approch towards support desugn
New approch towards support desugn
Pillar design
Pillar design
Wtidev 0430 tmoktia
1.
xAuthTwitterEngine
ASIHTTPRequest を使ってTwitPicに投稿する 沖田@tmokita 12年11月17日土曜日
2.
自己紹介
• 沖田ともひこ • フリープログラマ • 以前は組み込みとか ゲームとか • Twitter:@tmokita • お仕事ください 12年11月17日土曜日
3.
今回の発表の背景
• いまどきTwitter連携くらいしないと (*´・ω・)(・ω・`*)ネー • 画像系アプリなら画像も投稿したいよ (*´・ω・)(・ω・`*)ネー 12年11月17日土曜日
4.
参考サイト
• MetaArt TwitPicへ投稿する iPhoneアプリが出来るまで http://iphone.moo.jp/app/?p=571 • 非常に参考になりました ありがとうございます 12年11月17日土曜日
5.
申請とかしておいてね!
• TwitterにxAuthの申請をして APIキーなどを取得しておく https://dev.twitter.com/ • TwitPicに申請して APIキーを取得しておく http://dev.twitpic.com/ 12年11月17日土曜日
6.
使う主なライブラリ
• libXml • XAuthTwitterEngine https://github.com/aral/XAuthTwitterEngine • ASIHTTPRequest https://github.com/pokeb/asi-http-request MetaArtさんがまとめて下さってます http://apphokuson.googlecode.com/files/ 12年11月17日土曜日
7.
TwitPic→Twitter
ポストするまでの流れ • AccessToken取得 • TwitPicにポスト • レスポンスからTwitPicのURLを取得 • TwitPicのURLをTwitterにポスト 12年11月17日土曜日
8.
XAuthTwitterEngineDemoをベースに
TwitPic投稿を実装してみる 12年11月17日土曜日
9.
Twitterへのポスト
(1/1) • XAuthTwitterEngineDemoViewController.h ConsumerKey ConsumerSecret を定義する 12年11月17日土曜日
10.
• ここまでTwitterへのポスト 12年11月17日土曜日
11.
TwitPicへのポスト
(1/7) • twitpicpac をプロジェクトに追加 12年11月17日土曜日
12.
TwitPicへのポスト
(2/7) • 必要なフレームワークを追加 CFNetwork.framework MobileCoreServices.framework SystemConfiguration.framework libxml2.dylib libz.1.2.3.dylib • libXmlのパスを追加(ヘッダ検索パス) ${SDKROOT}/usr/include/libxml2 12年11月17日土曜日
13.
TwitPicへのポスト
(3/7) • 投稿する画像を追加 PostImage.jpg 12年11月17日土曜日
14.
TwitPicへのポスト
(4/7) • createOAuthEchoRequest uploadToTwitterByTwitPic 2つのメソッドをコピペさせて頂く • #import "ASIFormDataRequest.h" #import "OAMutableURLRequest.h" 12年11月17日土曜日
15.
TwitPicへのポスト
(5/7) • uploadToTwitterByTwitPic の編集 APIキーは http://dev.twitpic.com/apps/ で確認できる jsonをxmlにする TwitPicのキーを設定する 削除 12年11月17日土曜日
16.
TwitPicへのポスト
(6/7) • ASIHTTPRequestDelegate • #import "ASIHTTPRequestDelegate.h" 12年11月17日土曜日
17.
TwitPicへのポスト
(7/7) • ボタンを押したときの処理を変更 12年11月17日土曜日
18.
• ここまでTwitPicへのポスト 12年11月17日土曜日
19.
TwitPicのURLを
Twitterにポストする (1/3) • TwitPicからのレスポンス <?xml version="1.0" encoding="UTF-8"?> <image> <id>XXXXXX</id> <text>Testing xAuth from the XAuthTwitterEngineDemo!</text> <url>http://twitpic.com/XXXXXX</url> <width>256</width> <height>256</height> <size>56123</size> <type>jpg</type> <timestamp>Fri, 29 Apr 2011 12:05:43 +0000</timestamp> <user> <id>123456789</id> <screen_name>tmokita</screen_name> </user> </image> 12年11月17日土曜日
20.
TwitPicのURLを
Twitterにポストする (2/3) • URLを取得してTwitterにポストする • #import "XPathQuery.h" xPath 12年11月17日土曜日
21.
TwitPicのURLを
Twitterにポストする (3/3) • ポスト結果(Echofonで見た画面) 12年11月17日土曜日
22.
• めでたしめでたし 12年11月17日土曜日
23.
おまけメモ
(1/3) AccessTokenは一度取得すればOK 認証からポストまで一気にやろうとする場合にちょっとはまっ た点。 TwitterEngine::exchangeAccessTokenForUsername でアクセストークン取得出来るが、その値が返ってくるdelegate メソッド、storeCachedTwitterXAuthAccessTokenString これが呼ばれたときは、まだTwitterEngineのaccessTokenプロパ ティに値が入っていない。なので、ここからポストする場合は 一旦performSelectorとかで抜けてからやる必要がある。 12年11月17日土曜日
24.
おまけメモ
(2/3) XAuthTwitterEngineDelegate ASIHTTPRequestDelegate を書いといておけばそれぞれのdelegateがくる TwitterEngine::sendUpdateの方は - (void)requestSucceeded:(NSString *)connectionIdentifier - (void)requestFailed:(NSString *)connectionIdentifier withError: (NSError *)error が、 ASIの方は -(void)requestFinished:(ASIHTTPRequest*)request -(void)requestFailed:(ASIHTTPRequest*)request が、呼ばれる。 12年11月17日土曜日
25.
おまけメモ
(3/3) なので、認証から一気にやる場合、 1:TwitterEngine::exchangeAccessTokenForUsername 2:TwitterEngine::storeCachedTwitterXAuthAccessTokenString (Delegate) 3:2からperformSelectorとかで適当なメソッド呼ぶ 4:uploadToTwitterByTwitPic (ブログのメソッド) 5:ASI::requestFinished (Delegate) 6:TwitterEngine::sendUpdate 7:TwitterEngine::requestSucceeded (Delegate) っていう感じになる。 12年11月17日土曜日
26.
• ご清聴ありがとうございました 12年11月17日土曜日
Baixar agora