parse_posts: Parse CT Post List object

Description Usage Arguments Examples

View source: R/parse_posts.R

Description

Parses list of CT post objects(lists) into R data.frame

Usage

1
parse_posts(postlist, ...)

Arguments

postlist

A list with CT post objects

...

Additional parameters to be specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Pull all posts from November 2020 by CNN containing the term "Trump"
library(dplyr)
cnn_postlist  <- posts_search(token = crowdtangle_token(),
                    inAccountIds = "8323", #CNN example
                    searchTerm = "Trump",
                    startDate = "2020-11-01T00:00:00",
                    endDate = "2020-11-30T23:59:59",
                    count = 10000,
                    sortBy = 'date',
                    platforms = 'facebook',
                    search10k = T,
                    boolean_allowed = T,
                    output_raw = TRUE)

# Parse postlist to R data.frame
cnn_df <- cnn_postlist %>% parse_posts()

# Pull all link shares with URLs containing "rt.com" on December 7th, 2020
rt_postlist <-
links(token = crowdtangle_token(),
      count = 1000,
      endDate = '2020-12-07T23:59:59',
      includeHistory = NULL,
      link = "rt.com",
      includeSummary= 'false',
      offset = 0,
      platforms = 'facebook',
      searchField = 'Include_query_strings',
      startDate = '2020-12-07T00:00:00',
      sortBy = 'date')

 # Parse postlist to R data.frame
rt_df <- rt_postlist %>% parse_posts()

schliebs/rtangle documentation built on Dec. 22, 2021, 10:22 p.m.