Your SlideShare is downloading. ×
twitteRで快適Rライフ!
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

twitteRで快適Rライフ!

7,406
views

Published on

Japan.R #2のLT用スライドです

Japan.R #2のLT用スライドです

Published in: Technology, Design

0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,406
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
51
Comments
0
Likes
10
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. twitteR R Japan.R #2 (2011/11/26) @a_bicky
  • 2. • Takeshi Arabiki ‣ ‣ Twitter & : @a_bicky & id:a_bicky• R• http://d.hatena.ne.jp/a_bicky/
  • 3. R Osaka.R #4 Tokyo.R #16 Tsukuba.R #9http://www.slideshare.net/abicky/twitterr http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090
  • 4. R Osaka.R #4 Tokyo.R #16 Tsukuba.R #9http://www.slideshare.net/abicky/twitterr http://www.slideshare.net/abicky/r-9034336 http://www.slideshare.net/abicky/r-10128090 http://www.slideshare.net/abicky/rtwitter
  • 5. LT
  • 6. twitteR• RJSONIO•• ID status ID• fav favorited TRUE• truncated TRUE• DM• status character factor
  • 7. twitteR• RJSONIO•• ID status ID• fav favorited TRUE• truncated TRUE• DM• status character factor
  • 8. OAuth ” ” twitteR -
  • 9. OAuth ” ” twitteR -
  • 10. OAuth ” ” twitteR -
  • 11. OAuth ” ” twitteR - twittoru
  • 12. OAuth ” ” twitteR -
  • 13. OAuth ” ” twitteR -
  • 14. OAuth ” ” twitteR - twittoru
  • 15. OAuth ” ” twitteR - twittoru
  • 16. OAuth ” ” twitteR -R twittoru
  • 17. OAuth ” ” twitteR - yokkuns twittoru
  • 18. for Unix users
  • 19. for Unix usersWindows
  • 20. $ sudo R -e install.packages("twitteR")$ sudo R -e install.packages("ROAuth")
  • 21. RJSONIO$ sudo R CMD remove RJSONIO # 0.3$ wget http://cran.r-project.org/src/contrib/Archive/RJSONIO/RJSONIO_0.3-1.tar.gz$ sudo R CMD install RJSONIO_0.3-1.tar.gz
  • 22. twitteR ROAuth$ wget https://raw.github.com/gist/1378878 -O ROAuch.patch$ wget http://cran.r-project.org/src/contrib/ROAuth_0.9.0.tar.gz$ tar xvfz ROAuth_0.9.0.tar.gz$ patch -c -p1 -d ROAuth < ROAuth.patch$ sudo R CMD remove ROAuth$ sudo R CMD install ROAuth$ wget https://raw.github.com/gist/1378880 -O twitteR.patch$ wget http://cran.r-project.org/src/contrib/twitteR_0.99.14.tar.gz$ tar xvfz twitteR_0.99.14.tar.gz$ patch -c -p1 -d twitteR < twitteR.patch$ sudo R CMD remove twitteR$ sudo R CMD install twitteR
  • 23. https://dev.twitter.com/
  • 24. https://dev.twitter.com/
  • 25. https://dev.twitter.com/
  • 26. https://dev.twitter.com/
  • 27. ←←← URL
  • 28. ← Developer Rules Of The Road ← “Yes, I agree” ← URL“Create your Twitter application”
  • 29. “twitter”
  • 30. ← Consumer key← Consumer secret
  • 31. “Read, Write and Access direct messages” “Update this Twitter application’s settings”
  • 32. access token
  • 33. access token
  • 34. access token
  • 35. access token ← Access token ← Access token secretRead, write, and direct messages
  • 36. twitteRinit_twitteR.R library(twitteR) library(ROAuth) # Sys.setlocale("LC_TIME", "en_US.utf-8") # twit.oauth <- OAuthFactory$new( handshakeComplete = TRUE, signMethod = "HMAC", consumerKey = "vFIR1AYuMJN8X997BjplRw", consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4", oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW", oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE") # OAuth registerTwitterOAuth(twit.oauth)
  • 37. twitteRinit_twitteR.R library(twitteR) library(ROAuth) # Sys.setlocale("LC_TIME", "en_US.utf-8") # twit.oauth <- OAuthFactory$new( handshakeComplete = TRUE, signMethod = "HMAC", consumerKey = "vFIR1AYuMJN8X997BjplRw", consumerSecret = "p9ZtKxJONDdBO1rIYNiBSmXLJj3W0cKdizremBPb6T4", oauthKey = "103027920-8tmAeUQHLxIbDGmjrpJURCKQEDpxu7uHQrGLqphW", oauthSecret = "0ixZIMBDRQElQ9P2IrTNIeIvqR7zJzSp6ShNolYcbSE") # OAuth registerTwitterOAuth(twit.oauth) ※
  • 38. > source("init_twitteR.R")> tweet("Japan.R #japanr")
  • 39. DM> taskStatus({+ x <- sample(as.numeric(1:100), 100000000, replace =TRUE)+ ret <- sum(x)+ }, "a_bicky", sprintf(" %s", ret))[1] 5049839571
  • 40. DM> taskStatus({+ x <- sample(as.numeric(1:100), 100000000, replace =TRUE)+ ret <- sum(x)+ }, "a_bicky", sprintf(" %s", ret))[1] 5049839571
  • 41. R