Skip to content

“Event loop is closed” will be reported when failed to access twitter #293

@dengsong-yang

Description

@dengsong-yang

version: 2.20

use asyncio , “Event loop is closed” will be reported when failed to access twitter

example:

async def get_latest_tweet(USER_ID, TYPE) -> Tweet:
    tweets = await client.get_user_tweets(user_id=USER_ID, tweet_type=TYPE, count=10)
    if tweets:
        return tweets
    return None


if __name__ == '__main__':
    while True:
        try:
            asyncio.run(get_latest_tweet("1517030962764214272", "Tweets"))
        except Exception as e:
            print(e)
            continue

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions