R_Language 板


LINE

[問題類型]: 請把以下不需要的部份刪除 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 入門(寫過其他程式,只是對語法不熟悉) [問題敘述]: 大家好 我開始使用TwitteR 做Text Mining, 目前就是自己註冊了Twitter 建立了一個App 然後跟著網路上的步驟連結R與自己的App 就可以用指令搜尋需要的Tweet 然而 初學者總是會遇到一些系統問題 我使用的是 Mac 10.13.6 我是在 # Saving and using certification to connect to Twitter # Asing for access 這裡的時候 R會direct我到一個authorize的頁面 但我一按下Authorize (這是我的Twitter App的Authorize頁面) 就顯示: 127.0.0.1 refused to connect. 於是我就開始搜尋可能原因 以下先放上我的code 以及stackoverflow上面有人貼的command 我的mkdir: /private/var/log/apache2: File exists sudo apachectl configtest Syntax OK 並沒有出現error message 不知道有沒有也是mac使用者版友有類似經驗的 願意分享一下? 謝謝大家! [程式範例]: ## Install packages and set up working directory install.packages(c( "twitteR", "ROAuth", "RCurl" )) ## call the packages ## library(twitteR) library(ROAuth) library(RCurl) ## Getting a curl certification download.file(url = "http://curl.haxx.se/ca/cacert.pem", destfile = "cacert.pem") ## Setting the certification from Twitter # Set constant requestURL requestURL <- "https://api.twitter.com/oauth/request_token" # Set constant accessURL accessURL <- "https://api.twitter.com/oauth/access_token" # Set constant authURL authURL <- "https://api.twitter.com/oauth/authorize" # consumer key and consumer secret consumerKey <- XXXXXX consumerSecret <- OOOOOO # Create authorization object by calling function OAuthFactory twitCred <- OAuthFactory$new ( consumerKey = consumerKey, consumerSecret = consumerSecret, requestURL = requestURL, accessURL = accessURL, authURL = authURL) # Saving and using certification to connect to Twitter # Asing for access twitCred$handshake( cainfo = "cacert.pem") 這邊跳出 To enable the connection, please direct your web browser to: 我也順利進到頁面 但一點authorize就出現 This site can’t be reached 127.0.0.1 refused to connect. 有找到一個類似的苦主: https://stackoverflow.com/questions/39364290/why-would-apache-refuse- connection-to-localhost-127-0-0-1-on-osx [環境敘述]: R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/ vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib locale: [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RCurl_1.95-4.11 bitops_1.0-6 ROAuth_0.9.6 twitteR_1.1.9 loaded via a namespace (and not attached): [1] bit_1.1-14 httr_1.3.1 compiler_3.5.1 rjson_0.2.20 R6_2.2.2 DBI_1.0.0 tools_3.5.1 yaml_2.2.0 [9] bit64_0.9-7 digest_0.6.15 [關鍵字]: Twitter 選擇性,也許未來有用 -- --



※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 129.21.68.251
※ 文章網址: https://webptt.com/m.aspx?n=bbs/R_Language/M.1533077907.A.D05.html
1F:→ Wush978: 有先嘗試更新相關的套件嗎? twitter可能有改自己oauth的 08/02 08:32
2F:→ Wush978: 流程導致相關認證壞掉,也有可能是防火牆擋掉 08/02 08:32
3F:→ AmigoSafin: 我關了防火牆 然後看了rtweet的相關說明(是否twitteR 08/03 12:11
4F:→ AmigoSafin: 出問題我也忘了 但rtweet從github在下一次 然後用 08/03 12:12
5F:→ AmigoSafin: create_token(app, key, secret)順利用browser認證了 08/03 12:12
6F:→ AmigoSafin: 我之前一天就是一直在setup_twitter_oauth中鬼打牆 08/03 12:13
7F:推 Wush978: 總之,這種牽涉到其他第三方網路服務的出錯,SOP就是先 08/03 15:32
8F:→ Wush978: 更新看看套件,以及去套件的issue區看是不是已經有人回報 08/03 15:32
9F:→ AmigoSafin: 原來有SOP ^0^ 謝謝~~!! 08/05 03:18







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:WOW站內搜尋

TOP