tw_api_get_search_tweets: Gets status updates (tweets) via serach

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/twitter_api.R

Description

Using the twitter API, gets the status updates via search

Usage

1
2
3
4
tw_api_get_search_tweets(q, twitter_token, geocode = NULL, lang = NULL,
  locale = NULL, result_type = c("mixed", "recent", "popular"),
  count = 100, until = "9999-99-99", since_id = NULL, max_id = NULL,
  quietly = FALSE, ...)

Arguments

q

Search query

twitter_token

An object of class Token1.0 as generated by tw_gen_token.

geocode

character with 'latitude,longitude,radius', where radius units must be specified as either 'mi' (miles) or 'km' (kilometers)

lang

Restricts language

locale

Specifies the locale of the query

result_type

Either of the options especified

count

Number of statuses to get

until

character specifying the limit date (tweets before than) as YYYY-MM-DD

since_id

Returns results with an ID greater than (that is, more recent than) the specified ID

max_id

Returns results with an ID less than (that is, older than) or equal to the specified ID

quietly

Whether or not to show the 'success' message

...

Additional arguments passed to GET()

Details

Keep in mind that the search index has a 7-day limit. In other words, no tweets will be found for a date older than one week.

From Twitter

Returns a collection of relevant Tweets matching a specified query.

Please note that Twitter<e2><80><99>s search service and, by extension, the Search API is not meant to be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the search interface.

Value

A data.frame with tweets (if success), with the following columns:

otherwise returns NULL.

Author(s)

George G. Vega Yon

References

Twitter REST API (GET search/tweets) https://dev.twitter.com/rest/reference/get/search/tweets

See Also

tw_extract()

Other API functions: tw_api_get_followers_ids, tw_api_get_followers_list, tw_api_get_friends_ids, tw_api_get_statuses_sample, tw_api_get_statuses_user_timeline, tw_api_get_trends_place, tw_api_get_users_search, tw_api_get_users_show, tw_api_trends_available, tw_gen_token

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Getting the twitts (first gen the token)
key <- tw_gen_token('myapp','key', 'secret')

# Making a query
x <- tw_api_get_search_tweets('lovewins', key)

## End(Not run)

gvegayon/twitterreport documentation built on May 17, 2019, 9:30 a.m.