MCPcopy Index your code
hub / github.com/InstaPy/InstaPy / get_recent_posts_from_pods

Function get_recent_posts_from_pods

instapy/pods_util.py:27–41  ·  view source on GitHub ↗

fetches all recent posts shared with pods

(topic, logger)

Source from the content-addressed store, hash-verified

25
26
27def get_recent_posts_from_pods(topic, logger):
28 """fetches all recent posts shared with pods"""
29 params = {"topic": topic}
30 r = requests.get(get_server_endpoint(topic) + "/getRecentPostsV1", params=params)
31 try:
32 logger.info("Downloaded postids from Pod {}:".format(topic))
33 if r.status_code == 200:
34 logger.info(r.json())
35 return r.json()
36 else:
37 logger.error(r.text)
38 return []
39 except Exception as err:
40 logger.error("Could not get postids from pod {} - {}".format(topic, err))
41 return []
42
43
44def group_posts(posts, logger):

Callers 1

join_podsMethod · 0.85

Calls 1

get_server_endpointFunction · 0.85

Tested by

no test coverage detected