sc-common-interface 2.7.4__tar.gz → 2.7.5__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.7.4 → sc_common_interface-2.7.5}/PKG-INFO +1 -1
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/LiveCommonInterface.py +13 -8
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/setup.py +1 -1
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/setup.cfg +0 -0
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -200,10 +200,13 @@ def get_page_info(data):
|
|
|
200
200
|
platform = info["data"]["relatedPostList"][i]["platform"]
|
|
201
201
|
post_id = info["data"]["relatedPostList"][i]["post_id"]
|
|
202
202
|
group_id = info["data"]["relatedPostList"][i]["group_id"]
|
|
203
|
+
permalink_url = info["data"]["relatedPostList"][i]["permalink_url"]
|
|
203
204
|
page_info["page_id"] = page_id
|
|
204
205
|
page_info["platform"] = platform
|
|
205
206
|
page_info["post_id"] = post_id
|
|
206
207
|
page_info["group_id"] = group_id
|
|
208
|
+
page_info["permalink_url"] = permalink_url
|
|
209
|
+
|
|
207
210
|
elif sales_type.lower() == "post":
|
|
208
211
|
platform_list = jsonpath(info, "$..related_post_list..platform")
|
|
209
212
|
i = platform_list.index(platform.upper())
|
|
@@ -211,10 +214,12 @@ def get_page_info(data):
|
|
|
211
214
|
platform = info["data"]["related_post_list"][i]["platform"]
|
|
212
215
|
post_id = info["data"]["related_post_list"][i]["post_id"]
|
|
213
216
|
group_id = info["data"]["related_post_list"][i]["group_id"]
|
|
217
|
+
permalink_url = info["data"]["related_post_list"][i]["permalink_url"]
|
|
214
218
|
page_info["page_id"] = page_id
|
|
215
219
|
page_info["platform"] = platform
|
|
216
220
|
page_info["post_id"] = post_id
|
|
217
221
|
page_info["group_id"] = group_id
|
|
222
|
+
page_info["permalink_url"] = permalink_url
|
|
218
223
|
return page_info
|
|
219
224
|
|
|
220
225
|
|
|
@@ -236,11 +241,14 @@ def send__live_comment(data):
|
|
|
236
241
|
comment_id = data.get("comment_id", comment_id)
|
|
237
242
|
keyword = data.get("keyword", keyword)
|
|
238
243
|
# sales_type = data.get("sales_type", "live")
|
|
244
|
+
relationUrl = data.get("relationUrl")
|
|
239
245
|
if page_id == "" or post_id == "key":
|
|
240
246
|
page_info = get_page_info(data)
|
|
241
247
|
platform = page_info["platform"]
|
|
242
248
|
post_id = page_info["post_id"]
|
|
243
249
|
group_id = page_info["group_id"]
|
|
250
|
+
relationUrl = page_info["permalink_url"]
|
|
251
|
+
|
|
244
252
|
|
|
245
253
|
body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
|
|
246
254
|
"from": {"id": user_id, "name": name},
|
|
@@ -259,12 +267,12 @@ def send__live_comment(data):
|
|
|
259
267
|
"field": "comments"}]}], "object": "instagram"}
|
|
260
268
|
elif platform.upper() == "FB_GROUP":
|
|
261
269
|
t_time = stamp*1000
|
|
262
|
-
if "
|
|
270
|
+
if "_" in post_id:
|
|
263
271
|
post_id = post_id.split("_")[-1]
|
|
264
272
|
else:
|
|
265
273
|
# print("----")
|
|
266
|
-
relationUrl = data["relationUrl"]
|
|
267
|
-
match = re.search(r'groups/(\d+)/
|
|
274
|
+
# relationUrl = data["relationUrl"]
|
|
275
|
+
match = re.search(r'groups/(\d+)/permalink/(\d+)/', relationUrl)
|
|
268
276
|
group_id = match.group(1)
|
|
269
277
|
post_id = match.group(2)
|
|
270
278
|
comment_id = "%d%d" % ( stamp, num)
|
|
@@ -272,7 +280,7 @@ def send__live_comment(data):
|
|
|
272
280
|
"from":{"id":user_id,"name":name},"group_id":group_id,"post_id":post_id,"comment_id":comment_id,"created_time":stamp,"item":"comment",
|
|
273
281
|
"verb":"add","parent_id":post_id,"field":"group_feed"}]}]}
|
|
274
282
|
|
|
275
|
-
|
|
283
|
+
print(body)
|
|
276
284
|
url = "%s/facebook/webhook" % env
|
|
277
285
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
|
278
286
|
signData = sign_text.hexdigest()
|
|
@@ -2013,10 +2021,7 @@ def handler_auto_reply(data):
|
|
|
2013
2021
|
|
|
2014
2022
|
|
|
2015
2023
|
if __name__=="__main__":
|
|
2016
|
-
|
|
2017
|
-
data["keyword"] ="hhkfasfjasfjashfahfagagag"
|
|
2018
|
-
user_id, name, comment_id = send__live_comment(data)
|
|
2019
|
-
print(name)
|
|
2024
|
+
pass
|
|
2020
2025
|
|
|
2021
2026
|
|
|
2022
2027
|
|
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-2.7.4 → sc_common_interface-2.7.5}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|