Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Check if tweet is pinned #201

Open
FroostySnoowman opened this issue Jun 14, 2024 · 2 comments
Open

Question: Check if tweet is pinned #201

FroostySnoowman opened this issue Jun 14, 2024 · 2 comments
Labels
Milestone

Comments

@FroostySnoowman
Copy link

How would I check to see if a tweet is pinned?

@vladkens
Copy link
Owner

Hi, @FroostySnoowman.

What api method you use? Actually is no flags about it any model now.

If you scrape user profiles, ids should be in chronological order expect 1-3 first which can be pinned. So you can write some code to detect this

@vladkens vladkens changed the title Check if tweet is pinned Question: Check if tweet is pinned Jun 29, 2024
@vladkens vladkens added this to the v0.13 milestone Jun 29, 2024
@vladkens
Copy link
Owner

Added in v0.13

import asyncio

from twscrape import API


async def main():
    api = API()

    async for doc in api.user_tweets(2244994945, limit=10):
        print(doc.url, doc.id in doc.user.pinnedIds)


if __name__ == "__main__":
    asyncio.run(main())

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

No branches or pull requests

2 participants