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

Function group_posts

instapy/pods_util.py:44–64  ·  view source on GitHub ↗
(posts, logger)

Source from the content-addressed store, hash-verified

42
43
44def group_posts(posts, logger):
45 no_comments_post_ids = []
46 light_post_ids = []
47 normal_post_ids = []
48 heavy_post_ids = []
49 for postobj in posts:
50 try:
51 if postobj["mode"] == "no_comments":
52 no_comments_post_ids.append(postobj)
53 elif postobj["mode"] == "light":
54 light_post_ids.append(postobj)
55 elif postobj["mode"] == "heavy":
56 heavy_post_ids.append(postobj)
57 else:
58 normal_post_ids.append(postobj)
59 except Exception as err:
60 logger.error(
61 "Failed with Error {}, please upgrade your instapy".format(err)
62 )
63 normal_post_ids.append(postobj)
64 return no_comments_post_ids, light_post_ids, normal_post_ids, heavy_post_ids
65
66
67def share_my_post_with_pods(postid, topic, engagement_mode, logger):

Callers 1

join_podsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected