cjbarrie / academictwitteR

Repo for academictwitteR package to query the Twitter Academic Research Product Track v2 API endpoint.
Other
272 stars 59 forks source link

Exact phrase match queries #223

Closed laurieresearch closed 3 years ago

laurieresearch commented 3 years ago

Thanks academictwitteR developers for this great package.

I'm trying to build a query to match exact phrases in tweets e.g. "Black Lives Matter" (i.e. rather than tweets containing the words "Black" AND "Lives" AND "Matter" in any order).

There is no example given in the vignette for queries matching exact phrases and the build_query() function suggests that using double-quotes to demarcate a phrase won't be parsed e.g.

build_query(query = ""Black Lives Matter"") Error: unexpected symbol in "build_query(query = ""Black"

I'm making this assumption based on Twitter's documentation: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query

Have I missed something obvious or is there a simple work around here?

Thanks