Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
企業システムにおけるTwitter API適用事例とTwitter4Jアップデート #Twit...
Search
yusuke
September 17, 2022
Technology
0
200
企業システムにおけるTwitter API適用事例とTwitter4Jアップデート #TwitterDevJP
yusuke
September 17, 2022
Tweet
Share
More Decks by yusuke
See All by yusuke
Python開発環境 - PyCharmとAI #stapy
yusuke
1
18
PhpStorm超絶技巧40分集中講義 #phpconkagawa
yusuke
6
1.2k
PhpStorm超絶技巧20分集中講座 #phpcon_odawara #kama
yusuke
2
800
PHPカンファレンス北海道 - PhpStorm最新情報 #phpcondo
yusuke
1
140
PhpStorm最新情報 AIとnew UI、便利プラグイン #phpcon_okinawa
yusuke
0
340
最新JavaとIDE #jjug
yusuke
1
380
#projava #jjug 転生したらプロのJavaだった件
yusuke
1
280
まだ間に合うMaven(再)入門 #jjug
yusuke
2
2k
JANコード/バーコードの仕組み #zadrvnlt
yusuke
1
620
Other Decks in Technology
See All in Technology
Storage Browser for Amazon S3
miu_crescent
1
300
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
120
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
140
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
190
生成AIのガバナンスの全体像と現実解
fnifni
1
230
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
210
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
190
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
120
AWS re:Invent 2024 recap
hkoketsu
0
170
サーバーなしでWordPress運用、できますよ。
sogaoh
PRO
0
130
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
10
3.8k
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
For a Future-Friendly Web
brad_frost
175
9.4k
Rails Girls Zürich Keynote
gr2m
94
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Documentation Writing (for coders)
carmenintech
67
4.5k
How GitHub (no longer) Works
holman
311
140k
The Cost Of JavaScript in 2023
addyosmani
46
7k
Become a Pro
speakerdeck
PRO
26
5k
Transcript
اۀγεςϜʹ͓͚Δ Twitter APIద༻ࣄྫ @yusuke ࢁຊϢʔεέ ͱTwitter4JΞοϓσʔτ
w+BWB͖ͷ044σϕϩού w+BWBνϟϯϐΦϯ w5XJUUFS+࡞ऀ ͖ͳϒΩγϟʔϓϚʔΧʔ ϑϨϯυίʔυ48
5IFUJNFMJOF w ݄5XJUUFSɺ5XJUUFS"1*Λൃݟ w ݄5XJUUFS+ΛϦϦʔε w "1*͕͖͗ͯ͢5XJUUFSʹೖࣾ %FWFMPQFS"EWPDBUFͱͯ͠ ࠃσϕϩούͷࢧԉɺ%FWFMPQFS5FBUJNFͷ։࠵ w
ʙגࣜձࣾαϜϥΠζϜઃཱ
ྑ͋͘Δ5XJUUFS"1*ͷࣄྫ wΩϟϯϖʔϯ wήʔϜͰ࣮ΛπΠʔτ wট w4/4ΞΧϯτϩάΠϯ ίϯγϡʔϚ͚ͷద༻͕ଟ͍
גࣜձࣾαϜϥΠζϜ ւ֎ͷπʔϧɺαʔϏεൢച +FU#SBJOTɺ(JU)VCɺ%BUBEPH ࣗࣾ։ൃɾൢച !$*DMPOF
wࣾɺӦۀɺٕज़αϙʔτ໊ͷྵࡉاۀ wൢγεςϜɺ&$γεςϜ w๏ਓސ٬ઍɺݸਓސ٬ສ גࣜձࣾαϜϥΠζϜ ۀޮԽͷҰͱͯ͠Twitter APIΛར༻
גࣜձࣾαϜϥΠζϜγεςϜߏ &$ ൢചཧ ࢮ׆ࢹ ग़ୀࣾ௨
Ӧۀ࣌ؒ֎ɺॕٳʹ5XJUUFS%.Ͱ௨ &$ උߟཝʹ͍߹Θ͕ͤهࡌ ܾࡁ࣌ɺΧʔυ໊ٛ૬ҧ ॕٳɾӦۀ࣌ؒఆIUUQTHJUIVCDPNZVTVLFCVTJOFTT$BMFOEBS+ ൢചཧ ফ͠ࠐΈ࣌ɺֹۚෆҰக
ࢮ׆ࢹ αʔόμϯ ϨεϙϯεԆ αʔόূ໌ॻ༗ޮظݶ 5XJUUFS%.Ͱ௨
ग़ࣾୀࣾͰπΠʔτ ग़ୀࣾ௨ ग़ୀࣾঢ়گΛπΠʔτ
اۀͷ5XJUUFS"1*ར༻ wӦۀ࣌ؒ֎ॕٳʹ௨ wγεςϜͷΠϕϯτ wࣗಈԽͰग़དྷͳ͍ঝೝϫʔΫϑϩʔ wϚʔέςΟϯά w8FCαΠτ63-ɺϋογϡλάɺ໊Τΰα w$3. w%.ɺ!πΠʔτͰސ٬ରԠ
5XJUUFS࿈ܞ͢ΔϝϦοτ ʮ͍ͭݟ͍ͯΔπʔϧʯΛ͑Δ Ϟχλεɺʮར༻࣮ଶௐࠪϏδωενϟοτπʔϧฤʯΛൃදIUUQTNPOJUBTDPKQDIBU@UPPM
5XJUUFS࿈ܞ͢ΔϝϦοτ wը໘Λ࡞͢Δඞཁ͕ͳ͍ wํͷΓͱΓ؆୯ wϫϯλονͰΠϯλϥΫτՄೳ 2VJDLSFTQPOTFˠ
None
Ͳͷ"1*Λ͏͖͔ w"1*W "1*W w6TFS4USFBNTͷସʁ
WΛ͏ϝϦοτ wWʹ͔͠Ͱ͖ͳ͍͜ͱ wεϖʔεɺϒοΫϚʔΫͷΞΫηε
৽نʹAPIΛѻ͏ͳΒv2͕ѹతʹ͔Γ͍͢ WΛ͏ϝϦοτ w࣮ࡍͷ6*༻ޠͱ"1*༻ޠ͕౷Ұ͞Ε͍ͯΔ ྫ w"1*WGPMMPXFSGSJFOE w"1*WGPMMPXFSGPMMPXJOH
WΛ͏ϝϦοτ w"1*ઃܭ͕ϞμϯྫϑΥϩʔΛ֎͢ w7 %&-&5&VTFST\TPVSDF@VTFS@JE^GPMMPXJOH\UBSHFU@VTFS@JE^ w7 1045GSJFOETIJQTEFTUSPZKTPO VTFS@JE\VTFS@JE^
"1*WͰग़དྷͳ͍͜ͱ͋Δ wྫμΠϨΫτϝοηʔδૹड৴ IUUQTUSFMMPDPNCNZGS,X7UXJUUFSEFWFMPQFSQMBUGPSNSPBENBQ
"1*WʁWʁ w"1*WͰग़དྷΔ͜ͱ"1*WͰ wطଘΞϓϦٸ͍ͰҠߦ͢Δඞཁͳͦ͞͏
ΈΜͳେ͖6TFS4USFBNTͷସʁ w"DDPVOU"DUJWJUZ"1* w8FCIPPLͰϑΥϩʔɺ%.ͷ௨Λड৴ w࠶ଓॲཧෆཁ IUUQTEFWFMPQFSUXJUUFSDPNKBEPDTUVUPSJBMTHFUUJOHTUBSUFEXJUIUIFBDDPVOUBDUJWJUZBQJ
ΈΜͳେ͖6TFS4USFBNTͷସʁ w"DDPVOU"DUJWJUZ"1* w8FCIPPLͰϑΥϩʔɺ%.ͷ௨Λड৴ w࠶ଓॲཧෆཁ IUUQTEFWFMPQFSUXJUUFSDPNKBEPDTUVUPSJBMTHFUUJOHTUBSUFEXJUIUIFBDDPVOUBDUJWJUZBQJ ΫϥΠΞϯτΞϓϦ։ൃʹෆ͖
5XJUUFS+ϩʔυϚοϓ wཁ+BWB w"1*Wαϙʔτ wϞμϯͳΠϯλʔϑΣʔε wϞδϡʔϧαϙʔτ w!/VMMBCMF!/PU/VMM!3BOHFΞϊςʔτ w"DDPVOU"DUJWJUZ"1*αϙʔτ
ϞμϯͳΠϯλʔϑΣʔε Twitter twitter = new TwitterFactory(new ConfigurationBuilder() .setOAuthConsumerKey("my consumer key")
.setOAuthConsumerSecret("my consumer secret") .build()).getInstance(); Twitter twitter = Twitter.newBuilder() .oAuthConsumerKey("my consumer key") .oAuthConsumerSecret("my consumer secret") .build();
Ϟδϡʔϧαϙʔτ
!/VMMBCMF!/PU/VMM!3BOHFΞϊςʔτ ݱߦ 3BOHFΞϊςʔτ͖
"DDPVOU"DUJWJUZ"1*αϙʔτ var activity = TwitterAccountActivity.newBuilder() .onDirectMessageReceived(dm -> System.out.printf("direct message received:%s"
, dm.getText())) .onMention(tweet -> System.out.printf("mention received:%s" , tweet.getText())) .onPort(8080).build(); activity.start(); activity.await();
3&45"1* ΠϕϯτυϦϒϯ var restActivity = TwitterRestBasedAccountActivity .newBuilder() .onDirectMessageReceived(dm -> System.out.printf("direct
message received:%s" , dm.getText())) .onMention(tweet -> System.out.printf("direct message received:%s" , tweet.getText())) .pollIntervalSeconds(60).build(); restActivity.start(); restActivity.await();
IUUQTHJUIVCDPN5XJUUFS+5XJUUFS+
ਐԽ͢Δ5XJUUFS ਐԽ͢Δ5XJUUFS"1* "1*Λ׆༻ͯ͠ҰॹʹਐԽ͠·͠ΐ͏ʂ
اۀγεςϜʹ͓͚Δ Twitter APIద༻ࣄྫ @yusuke ࢁຊϢʔεέ ͱTwitter4JΞοϓσʔτ