fetches all recent posts shared with pods
(topic, logger)
| 25 | |
| 26 | |
| 27 | def 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 | |
| 44 | def group_posts(posts, logger): |
no test coverage detected