Skip to content

Update 5-how-to-write-search-queries.md #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/5-how-to-write-search-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ The logical AND between corona and coronavirus will be applied first followed by

The is:retweet operator filters for only those Tweets that are retweets and the ‘-’ indicates negation of this condition

## Give me all tweets of some different accounts

`(from:TwitterDev OR from:DevTwitter OR from:AnotherUser)`

It will be used with other queries like this:

`has:geo (from:TwitterDev OR from:DevTwitter OR from:AnotherUser) -is:retweet`

## Give me all Tweets that contain the word covid-19 and have geo data associated with them

`covid-19 has:geo`
Expand Down Expand Up @@ -88,6 +96,8 @@ You can always refer to this cheat sheet below with examples of operators and ho

For best practices and detailed examples, check out our comprehensive [guide on building high quality filters to get Tweets](https://developer.twitter.com/content/developer-twitter/en/docs/tutorials/building-high-quality-filters).

Twitter building query document will be helpful: [Building queries for Search Tweets](https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query)

In the next module, we will look at code samples for getting Tweets using the [academicTwitteR](https://cran.r-project.org/web/packages/academictwitteR/index.html) package in R and the [twarc](https://github.com/DocNow/twarc) library in Python.

[![Next](../assets/next.png)](../modules/6-labs-code-samples.md)