MCPcopy Create free account
hub / github.com/cxapython/catvm / crawl

Function crawl

twitter/twitter_article.py:63–78  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

61
62
63def crawl(name):
64 gt = get_gt()
65 user_id = get_user_id(name, gt)
66 headers = {
67 'authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
68 'x-guest-token': f'{gt}',
69 }
70
71 params = (
72 ('variables',
73 '{"userId":"%s","count":1000,"withHighlightedLabel":false,"withTweetQuoteCount":false,"includePromotedContent":false,"withTweetResult":true,"withReactions":false,"withSuperFollowsTweetFields":false,"withSuperFollowsUserFields":false,"withUserResults":false,"withClientEventToken":false,"withBirdwatchNotes":false,"withBirdwatchPivots":false,"withVoice":true}' % user_id),
74 )
75
76 response = requests.get('https://twitter.com/i/api/graphql/SvuhrsBPMT3klXIONc0gtQ/UserTweets', headers=headers,
77 params=params)
78 return response.json()
79
80
81def parse(exec_name, data, url):

Callers 1

runFunction · 0.85

Calls 2

get_gtFunction · 0.70
get_user_idFunction · 0.70

Tested by

no test coverage detected