Using regex in the Twitter API

I am using Tweedy Library in Python to search for tweets. I am wondering if I can use regex to search for tweets.

I am using the following code:

query = 'ARNOLD or SYLVESTER'     
for tweet in tweepy.Cursor(api.search,
                            query,
                            count=100,
                            result_type="recent",
                            include_entities=True,
                            lang="en").items():

For example, is it possible to search for all tweets that use "ARNOLD" or "SYLVESTER" (all capital / single words), ignore all other tweets.

I am currently processing tweets after receiving all tweets consisting of Arnold or Sylvester, and then checking to see if all the characters are in upper case. I am wondering if this can be done through an API lookup.

thank

+4
source share
1 answer

Twitter, , , , . Twitter, , API Twitter post-processes ( ). , , . Twitter API API , :

A UTF-8, URL- 1000 , . .

- UTF-8, , , . , regex, API, .

, , , Twitter.

+9

Source: https://habr.com/ru/post/1538573/


All Articles