GithubHelp home page GithubHelp logo

Comments (1)

igorbrigadir avatar igorbrigadir commented on August 20, 2024 1

Sure thing - the twarc2 search command only takes a single query, not a text file as input. for that you need searches:

twarc2 searches --limit 10000 --start-time 2020-03-16 --end-time 2021-01-08 --archive input.txt output.jsonl

The input text file input.txt is 1 separate search query per line, but they will all be written to the same output file, output.jsonl in this case. You can combine them with OR with the flag --combine-queries, sometimes this speeds things up, but usually it's not necessary.

I will note that the progress bar becomes less responsive in this way, so it may look like twarc isn't working but it is. This is still an open issue #561 same thing there applies to searches command, and all bulk commands.

To get your search in the text file to work, put it all on one line, so:

(example OR examples OR #idea1 OR #idea2 OR #idea3 OR #idea4) -is:retweet lang:en

And add parentheses around OR clauses.

If those were meant to be separate queries, you have to add the operators to every line, so if you wanted:

(example OR examples) -is:retweet lang:en
(#idea1 OR #idea2 OR #idea3 OR #idea4) -is:retweet lang:en

Hope that helps! See https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query on building queries in general.

from twarc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.