I saw a nice demonstration of tweets from R in a presentation a few months ago. The zero code used by the presenter is here:
http://www.r-bloggers.com/twitter-from-r%E2%80%A6-sure-why-not/
short and sweet code: library ("RCurl") opts <- curlOptions (header = FALSE, userpwd = "username: password", netrc = FALSE)
tweet <- function(status){
method <- "http://twitter.com/statuses/update.xml?status="
encoded_status <- URLencode(status)
request <- paste(method,encoded_status,sep = "")
postForm(request,.opts = opts)
}
With this function, you can send a tweet simply using the update function:
tweet("This tweet comes from R! #rstats")
I thought this might be a useful way to announce the completion of long work assignments. I tried to run this on my machine and I got some error:
[1] "\n\n \n\n"
( "Content-Type" )
"application/xml" "utf-8"
:
postForm (,.opts = opts): ,
, , ? , R -, !!