Description Usage Arguments Value Examples
Search for stories with various parameters. Multiple parameters
will be connected with AND in the call.
count_stories
gets the total number of stories, possibly by date. count_tags
gets the total number of stories by tags.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | count_stories(
text = NULL,
title = NULL,
media_id = NULL,
after_date = NULL,
before_date = NULL,
split = TRUE,
split_period = "day",
key = NULL,
tibble = TRUE
)
count_tags(
text = NULL,
title = NULL,
media_id = NULL,
after_date = NULL,
before_date = NULL,
n = 1000,
tag_sets_id = NULL,
key = NULL,
tibble = TRUE
)
|
text |
Optional character vector for full text search passed to the Solr query. If character vector contains more than one element, elements will be connected with OR. |
title |
Optional character vector for title search passed to the Solr query. If character vector contains more than one element, elements will be connected with OR. |
media_id |
Optional media ids (see |
after_date |
Limit results to stories published after this date. Should
be a date string that can be interpreted as a |
before_date |
Limit results to stories published before this date. Should
be a date string that can be interpreted as a |
split |
logical, either or not to split the count by |
split_period |
character, split the couny by this granularity, possible values are "day", "week", "month", and "year" |
key |
MediaCloud API key. Will be read from environment
variable 'MEDIACLOUD_API_KEY' if set to |
tibble |
Logical indicating whether result should be returned as
a tibble. Default to |
n |
numeric, maximum number of tags to return |
tag_sets_id |
character, if not NULL, only tags belonging to this tag sets is returned. For example, the tag set id of "2389" is tag set of people as identified by the CLIFF named-entity annotator. |
depending on the parameter tibble
, the return object can be a tibble (tibble
is TRUE) or a list (tibble
is FALSE).
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
## search for daily count of articles mentioning "klimawandel" in German media
de_media <- search_media(tag = "Germany___National")
res_kw <- count_stories(text = "klimawandel", after_date = "2021-01-01",
before_date = "2021-12-22", media_id = de_media$media_id,
split = TRUE, split_period = "day")
## search for popular named entities in articles mentioning "covid" in German media
count_tags(text = "covid", media_id = de_media$media_id, n = 100,
after_date = "2020-01-01", tag_sets_id = "2389")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.