d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot

Home Page:https://twikit.readthedocs.io/en/latest/twikit.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What purpose does `Tweet.state` hold?

srfsh opened this issue · comments

Hey, there. Firstly, many thanks for the great work you have done. It is invaluable to many of us, I can assure you. :)

I was looking at the docs regarding what is presented over to us and I encountered this field called state. I wasn't quite sure what it was, but it sure was related to the views count somehow. I took a quest online to find out what that field might be used for and if it is any use to me, but my inquiry resulted with no useful information at hand. I tried to have a look at the the "raw" response1 from Twitter (using pbd), but that didn't bear any useful result either.

The only thing I know is that the value "EnabledWithCount" is somehow involved with this field, but as I wasn't able to inspect the other possible values of that field, I can't quite conclude something sensible. It would be greatly appreciated if you could offer your insights on this, and possibly, update the docs accordingly.

Many thanks, cheers!

Footnotes

  1. "views": {
    "count": "",
    "state": "EnabledWithCount"
    },

commented

@denizenging

It seems that "state" indicates whether the view count of a tweet is valid. To make this clearer I plan to rename the field from "state" to "view_count_state" in the next update.

Thank you for your report.

I realized something quite interesting while performing some experiments. It appears that, when state is "Enabled" (another value I've just discovered), the view_count is None. I discovered this while iterating over some posts. This is something to note about.

"state" indicates whether the view count of a tweet is valid.

What does "valid" refer to here? Because if the value is "Enabled", then it seems that the view_count is not available somehow.