Browse Source

Add: initial facebook-collector (WIP)

pull/1/head
janwey 1 year ago
parent
commit
a3d238483c
1 changed files with 24 additions and 1 deletions
  1. 24
    1
      collector.R

+ 24
- 1
collector.R View File

@@ -23,7 +23,7 @@ library("Rfacebook")
#twitter_tokenaccess <- readline("[Twitter] Enter your Access Token.")
#twitter_tokensecret <- readline("[Twitter] Enter your Token Secret.")
#### Saved credentials
twitter_api_cred <- read.table(file = "./twitter_api.txt", heade = TRUE, sep = ";")
twitter_api_cred <- read.table(file = "./twitter_api.txt", header = TRUE, sep = ";")
twitter_consumerkey <- as.character(twitter_api_cred$consumer_key)
twitter_consumerpri <- as.character(twitter_api_cred$consumer_private)
twitter_tokenaccess <- as.character(twitter_api_cred$access_token)
@@ -138,3 +138,26 @@ for(i in 1:length(twitter_tw)){
#twitter_url
#twitter_txt
# }}}

## Facebook Collector [WIP] {{{ ----

### Authenticate to Facebook
#### Manual input (uncomment if needed)
#facebook_app_id <- readline("[Twitter] Enter your App ID key.")
#facebook_secret <- readline("[Twitter] Enter your App Secret.")
#### Saved credentials
facebook_api_cred <- read.table(file = "./facebook_api.txt", header = TRUE, sep = ";")
facebook_app_id <- as.character(facebook_api_cred$app_id)
facebook_secret <- as.character(facebook_api_cred$app_secret)

facebook_oath <- fbOAuth(app_id = facebook_api_id,
app_secret = facebook_secret)

### Get posts from FSFE
facebook_fsfe_posts <- Rfacebook::getPage(page = "thefsfe",
token = facebook_oauth,
since = "2018-01-01",
until = "2018-31-12",


# }}}

Loading…
Cancel
Save