MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / dump

Function dump

projects/reddit-scraper/grabnews.py:11–20  ·  view source on GitHub ↗
(endpoint, toget)

Source from the content-addressed store, hash-verified

9
10
11def dump(endpoint, toget):
12 headers = {"User-agent": "Chrome"}
13 unique = set()
14 url = (
15 "http://www.reddit.com/r/python/" + str(endpoint) + "/.json?limit=" + str(toget)
16 )
17 response = requests.get(url, headers=headers)
18 data = json.loads(response.text)
19 # parsed = json.dumps(data, indent = 4, sort_keys = True)
20 return data
21
22
23def _news(data, toget, unique):

Callers 2

get_top_newsFunction · 0.85
get_hot_newsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected