Rtweet - streaming tweets

Can Rtweet be used in a way to stream tweets based on both pre-defined keywords and a specific location?

Much thanks

The documentation on the devel version says it is possible to search for specific location and filter the content.
Have you tried to do both at the same time? What were your results?

I have tried it but the results were inconclusive.

Should you define both the filter keywords and the location as part of the query?

What does it mean inconclusive? Could you provide the code and results you tried? This would make it easier to answer/help you and it might help future readers.
If you are trying to do both, it seems reasonable to filter by keywords and location as part of the same query.

I am currently executing this code:

live_tweets <- stream_tweets(q="car,traffic",c(-125,50,-130,60),timeout = streamtime, parse = FALSE, file_name = paste0(filename,".json"), language = "en",token = oauth)

My query (q) is a combination of both keywords and location. When I run this code the following error pops up:
Warning messages:
1: In if (verbose) { :
the condition has length > 1 and only the first element will be used
2: In if (verbose) { :
the condition has length > 1 and only the first element will be used
3: In if (verbose) message("streaming data saved as ", file_name) :
the condition has length > 1 and only the first element will be used

Thus rtweet is only using one part of my query. What do you suggest please?

Much thanks

These warnings either indicate that there is a problem with the query or that you provided something incorrect. Check how to pass the query.

My problem is that there is no documentation regarding passing 2 parameters as your query but only 1.

Sorry it is not my query

This is the only documentation I found:
image
It basically states that a query can be made using one of four methods.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.