Mais conteúdo relacionado
Semelhante a twitteRで快適Rライフ! (20)
Mais de Takeshi Arabiki (16)
twitteRで快適Rライフ!
- 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 #9
http://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 #9
http://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
- 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
- 11. OAuth ” ” twitteR -
twittoru
- 14. OAuth ” ” twitteR -
twittoru
- 15. OAuth ” ” twitteR -
twittoru
- 16. OAuth ” ” twitteR -
R
twittoru
- 17. OAuth ” ” twitteR -
yokkuns
twittoru
- 22. $ sudo R -e 'install.packages("twitteR")'
$ sudo R -e 'install.packages("ROAuth")'
- 23. 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
- 24. 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
- 32. ←
Developer Rules Of The Road
←
“Yes, I agree”
← URL
“Create your Twitter application”
- 38. “Read, Write and Access direct messages”
“Update this Twitter application’s settings”
- 42. access token
← Access token
← Access token secret
Read, write, and direct messages
- 43. twitteR
init_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)
- 44. twitteR
init_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)
※
- 47. DM
> taskStatus({
+ x <- sample(as.numeric(1:100), 100000000, replace =
TRUE)
+ ret <- sum(x)
+ }, "a_bicky", sprintf(" %s", ret))
[1] 5049839571
- 48. DM
> taskStatus({
+ x <- sample(as.numeric(1:100), 100000000, replace =
TRUE)
+ ret <- sum(x)
+ }, "a_bicky", sprintf(" %s", ret))
[1] 5049839571