sc-common-interface 2.3.6__tar.gz → 2.3.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/PKG-INFO +1 -1
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/LiveCommonInterface.py +14 -10
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/PostCommonInterface.py +3 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/setup.py +1 -1
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/McCommonInterface.py +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/setup.cfg +0 -0
{sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -56,19 +56,23 @@ def send__live_comment(data):
|
|
|
56
56
|
platform = "FACEBOOK"
|
|
57
57
|
page_id = ""
|
|
58
58
|
post_id = ""
|
|
59
|
+
group_id = ""
|
|
59
60
|
if "page_id" in data:
|
|
60
61
|
page_id = data['page_id']
|
|
61
62
|
if "platform" in data:
|
|
62
63
|
platform = data['platform']
|
|
63
64
|
if "post_id" in data:
|
|
64
65
|
post_id = data['post_id']
|
|
66
|
+
if "group_id" in data:
|
|
67
|
+
post_id = data['group_id']
|
|
65
68
|
if page_id == "" or post_id == "":
|
|
66
69
|
info = get_live_info(data)
|
|
67
70
|
platform_list = jsonpath(info, "$..relatedPostList..platform")
|
|
68
71
|
i = platform_list.index(platform)
|
|
69
72
|
page_id = info["data"]["relatedPostList"][i]["page_id"]
|
|
70
73
|
platform = info["data"]["relatedPostList"][i]["platform"]
|
|
71
|
-
post_id =
|
|
74
|
+
post_id = info["data"]["relatedPostList"][i]["post_id"]
|
|
75
|
+
group_id = info["data"]["relatedPostList"][i]["group_id"]
|
|
72
76
|
# info = get_live_info(data)
|
|
73
77
|
# related_post_list = info["data"]["relatedPostList"][0]
|
|
74
78
|
# page_id = related_post_list["page_id"]
|
|
@@ -95,21 +99,21 @@ def send__live_comment(data):
|
|
|
95
99
|
"promotion_status": "inactive", "id": post_id}, "message": keyword, "item": "comment",
|
|
96
100
|
"verb": "add", "post_id": post_id, "comment_id": comment_id,
|
|
97
101
|
"created_time": stamp, "parent_id": post_id}}]}]}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
# "from": {"id": user_id, "name": name},
|
|
101
|
-
# "post": {"status_type": "added_video", "is_published": True, "updated_time": "2022-11-18T09:57:26+0000",
|
|
102
|
-
# "permalink_url": "https://www.facebook.com/permalink.php?story_fbid=pfbid02jLK3e6YdFSXp2DmD7j7vtStLXoBzTi8rxKrp6jFhVMUTTEgz6qvZA8soR9Uwydd8l&id=107977035056574",
|
|
103
|
-
# "promotion_status": "inactive", "id": post_id}, "message": keyword, "item": "comment",
|
|
104
|
-
# "verb": "add", "post_id": post_id, "comment_id": comment_id,
|
|
105
|
-
# "created_time": stamp, "parent_id": post_id}}]}]}
|
|
106
|
-
if platform == "INSTAGRAM":
|
|
102
|
+
|
|
103
|
+
if platform.upper() == "INSTAGRAM":
|
|
107
104
|
body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {"from": {"id": user_id,
|
|
108
105
|
"username": name},
|
|
109
106
|
"media": {"id": post_id,
|
|
110
107
|
"media_product_type": "FEED"},
|
|
111
108
|
"id": comment_id, "text": keyword},
|
|
112
109
|
"field": "comments"}]}], "object": "instagram"}
|
|
110
|
+
elif platform.upper() == "FB_GROUP":
|
|
111
|
+
t_time = stamp*1000
|
|
112
|
+
post_id = post_id.split("_")[-1]
|
|
113
|
+
comment_id = "%d%d" % ( stamp, num)
|
|
114
|
+
body = {"object":"page","entry":[{"id":page_id,"time":t_time,"messaging":[{"recipient":{"id":page_id},"message":keyword,
|
|
115
|
+
"from":{"id":user_id,"name":name},"group_id":group_id,"post_id":post_id,"comment_id":comment_id,"created_time":stamp,"item":"comment",
|
|
116
|
+
"verb":"add","parent_id":post_id,"field":"group_feed"}]}]}
|
|
113
117
|
print(body)
|
|
114
118
|
url = "%s/facebook/webhook" % env
|
|
115
119
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
{sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.3.6 → sc-common-interface-2.3.7}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|