twhttp.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:twtxt 作者: buckket 项目源码 文件源码
def get_remote_tweets(sources, limit=None, timeout=5.0, cache=None):
    conn = aiohttp.TCPConnector(use_dns_cache=True)
    headers = generate_user_agent()
    with aiohttp.ClientSession(connector=conn, headers=headers, conn_timeout=timeout) as client:
        loop = asyncio.get_event_loop()

        def start_loop(client, sources, limit, cache=None):
            return loop.run_until_complete(process_sources_for_file(client, sources, limit, cache))

        tweets = start_loop(client, sources, limit, cache)

    return tweets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号