Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Can't find any tweet #1349

Open
G-Pavel opened this issue Feb 9, 2022 · 12 comments
Open

Can't find any tweet #1349

G-Pavel opened this issue Feb 9, 2022 · 12 comments

Comments

@G-Pavel
Copy link

G-Pavel commented Feb 9, 2022

Hi guys!
Can't find any tweets from user @BPharmCatalyst
[!] No more data! Scraping will stop now. found 0 deleted tweets in this search.

Could you check please:

twint -u BPharmCatalyst

Maybe it's just my mistake ((

@minamotorin
Copy link

Same for me.

twint uses Twitter search for scrape user's Tweets.
But @BPharmCatalyst's Tweets are not shown.
The cause may be Twitter's search rules.

Alternatively, you can scrape user's Tweets and RTs via twint -u BPharmCatalyst --retweets.
Only recent Tweets can be displayed.

This option will cause JSONDecodeError.
About the error, see #1335.

@G-Pavel
Copy link
Author

G-Pavel commented Feb 11, 2022

Same for me.

twint uses Twitter search for scrape user's Tweets. But @BPharmCatalyst's Tweets are not shown. The cause may be Twitter's search rules.

Alternatively, you can scrape user's Tweets and RTs via twint -u BPharmCatalyst --retweets. Only recent Tweets can be displayed.

This option will cause JSONDecodeError. About the error, see #1335.

Many thanks!
I fixed the error JSONDecodeError as you said.
And now instead
twint.run.Search(c)
I use something like this to search for a tweets:

tweets = []

c = twint.Config()
c.Limit=100
c.Store_object_tweets_list = tweets

twint.run.Profile(c)
    
tweets = c.Store_object_tweets_list

p.s. Damn, twint needs a major update ((

@lyhtllw
Copy link

lyhtllw commented Feb 17, 2022

@G-Pavel Hi,I failed to get tweets from user @BPharmCatalyst by your code ,Is there anything wrong with my use?

tweets = []

c = twint.Config()
c.Username = "BPharmCatalyst"
c.Limit=100
c.Store_object_tweets_list = tweets

twint.run.Profile(c)
    
tweets = c.Store_object_tweets_list```

@G-Pavel
Copy link
Author

G-Pavel commented Feb 17, 2022

@G-Pavel Hi,I failed to get tweets from user @BPharmCatalyst by your code ,Is there anything wrong with my use?

tweets = []

c = twint.Config()
c.Username = "BPharmCatalyst"
c.Limit=100
c.Store_object_tweets_list = tweets

twint.run.Profile(c)
    
tweets = c.Store_object_tweets_list```

Hi,
It twint -u BPharmCatalyst --retweets doesn't work anymore:

[!] Twitter does not return more data, scrape stops here.

I don't know what to do, it's complete nonsense ((
@minamotorin do you or anyone else have any ideas?

@minamotorin
Copy link

minamotorin commented Feb 17, 2022

@lyhtllw
You forgot c.Store_object = True.

# This patch is in the public domain.
  tweets = []

  c = twint.Config()
  c.Username = "BPharmCatalyst"
  c.Limit=100
  c.Store_object_tweets_list = tweets
+ c.Store_object = True

  twint.run.Profile(c)
    
  tweets = c.Store_object_tweets_list

@lyhtllw @G-Pavel
The cause is Twitter's changes.
I updated my code. minamotorin/twint minamotorin/twint

This code looks working. But I haven't tested the code seriously.
This means there might be omissions in the scraping results of Tweets (reports are welcome).

@G-Pavel
Copy link
Author

G-Pavel commented Feb 17, 2022

@lyhtllw You forgot c.Store_object = True.

# This patch is in the public domain.
  tweets = []

  c = twint.Config()
  c.Username = "BPharmCatalyst"
  c.Limit=100
  c.Store_object_tweets_list = tweets
+ c.Store_object = True

  twint.run.Profile(c)
    
  tweets = c.Store_object_tweets_list

@lyhtllw @G-Pavel The cause is Twitter's changes. I updated my code. minamotorin/twint

This code looks working. But I haven't tested the code seriously. This means there might be omissions in the scraping results of Tweets (reports are welcome).

Seems to work, thanks a lot!

@Tegrisco-ZSQ
Copy link

@lyhtllw You forgot c.Store_object = True.

# This patch is in the public domain.
  tweets = []

  c = twint.Config()
  c.Username = "BPharmCatalyst"
  c.Limit=100
  c.Store_object_tweets_list = tweets
+ c.Store_object = True

  twint.run.Profile(c)
    
  tweets = c.Store_object_tweets_list

@lyhtllw @G-Pavel The cause is Twitter's changes. I updated my code. minamotorin/twint

This code looks working. But I haven't tested the code seriously. This means there might be omissions in the scraping results of Tweets (reports are welcome).

It's working, super helpful!!

@minamotorin
Copy link

This case is different, but it seems that the same problem may occur due to the account id changes.

E.g., if the id is changed from @before to @after, twint -u after return the tweets only after that point.
You can scrape the tweets until that point via twint -u before or twint -u after --retweets.

@Tegrisco-ZSQ
Copy link

@lyhtllw You forgot c.Store_object = True.

# This patch is in the public domain.
  tweets = []

  c = twint.Config()
  c.Username = "BPharmCatalyst"
  c.Limit=100
  c.Store_object_tweets_list = tweets
+ c.Store_object = True

  twint.run.Profile(c)
    
  tweets = c.Store_object_tweets_list

@lyhtllw @G-Pavel The cause is Twitter's changes. I updated my code. minamotorin/twint

This code looks working. But I haven't tested the code seriously. This means there might be omissions in the scraping results of Tweets (reports are welcome).

I tested the code. There are omissions in the searching results with c.Since and c.Until option. The number reported from the code mismatches with the number of tweets stored in csv.
@minamotorin do you have any idea about this issue? Thanks.

@minamotorin
Copy link

@Tegrisco-ZSQ
Are there any example?
In my environment, the problem doesn't seems to be happening.

How can I see this number?

The number reported from the code

@Tegrisco-ZSQ
Copy link

Tegrisco-ZSQ commented Mar 9, 2022

@Tegrisco-ZSQ Are there any example? In my environment, the problem doesn't seems to be happening.

How can I see this number?

The number reported from the code

@minamotorin
The code I used:

def get_tweets(start_date, end_date, keyword, filename):
    c = twint.Config()
    c.Search = keyword
    c.Since = start_date
    c.Until = end_date
    c.Hide_output = False
    c.Lang = 'en'
    c.Count = True
    c.Store_csv = True
    c.Output = filename
    twint.run.Search(c)

get_tweets('2022-01-01', '2022-01-05', '$V','V.csv')

The keyword is a cashtag '$V'

The screenshot is the search result from code:

Screen Shot 2022-03-09 at 1 49 39 PM

But I only got 317 tweets in the csv file.
V.csv

This issue happens when I use other keywords like '$GME', '$MSFT', etc.

@minamotorin
Copy link

minamotorin commented Mar 15, 2022

@Tegrisco-ZSQ

This can happen with also original twint and this has nothing to do with my code.
Moreover, this is jut display bug and the mismatches doesn't mean there are omissions.

By the way, there is a another bug which causes omissions with since or until. #1136
Perhaps I fixed this in minamotorin@ef04733, and the display bug may also be fixed as a result.

About bug of this update, please report to minamotorin/twint.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants