sc-common-interface 2.3.8__tar.gz → 2.3.9__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.8 → sc-common-interface-2.3.9}/PKG-INFO +1 -1
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/LiveCommonInterface.py +11 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/PostCommonInterface.py +15 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/setup.py +1 -1
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/McCommonInterface.py +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/setup.cfg +0 -0
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -57,6 +57,7 @@ def send__live_comment(data):
|
|
|
57
57
|
page_id = ""
|
|
58
58
|
post_id = ""
|
|
59
59
|
group_id = ""
|
|
60
|
+
|
|
60
61
|
if "page_id" in data:
|
|
61
62
|
page_id = data['page_id']
|
|
62
63
|
if "platform" in data:
|
|
@@ -114,6 +115,7 @@ def send__live_comment(data):
|
|
|
114
115
|
body = {"object":"page","entry":[{"id":page_id,"time":t_time,"messaging":[{"recipient":{"id":page_id},"message":keyword,
|
|
115
116
|
"from":{"id":user_id,"name":name},"group_id":group_id,"post_id":post_id,"comment_id":comment_id,"created_time":stamp,"item":"comment",
|
|
116
117
|
"verb":"add","parent_id":post_id,"field":"group_feed"}]}]}
|
|
118
|
+
|
|
117
119
|
print(body)
|
|
118
120
|
url = "%s/facebook/webhook" % env
|
|
119
121
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
|
@@ -129,6 +131,12 @@ def send_mc_message(data):
|
|
|
129
131
|
key = data["key"]
|
|
130
132
|
stamp = int(time.time()*1000)
|
|
131
133
|
user_id = "488864%d" % int(time.time())
|
|
134
|
+
type = "commment"
|
|
135
|
+
payload = "{}"
|
|
136
|
+
if "payload" in data:
|
|
137
|
+
payload = json.dumps(data["payload"])
|
|
138
|
+
if "type" in data:
|
|
139
|
+
type = data["type"]
|
|
132
140
|
if "user_id" in data:
|
|
133
141
|
user_id = data['user_id']
|
|
134
142
|
name = "test live%d" % int(time.time())
|
|
@@ -164,6 +172,9 @@ def send_mc_message(data):
|
|
|
164
172
|
if platform.upper()=="INSTAGRAM":
|
|
165
173
|
body={"object":"instagram","entry":[{"time":stamp,"id":"%s"%page_id,"messaging":[{"sender":{"id":"%s"%user_id},"recipient":{"id":"%s"%page_id},
|
|
166
174
|
"timestamp":stamp,"message":{"mid":"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwMzgwODgwNTMzOjM0MDI4MjM2Njg0MTcxMDMwMTI0NDI3NjAyNDExMzcwMDc2NTA5MDozMTgzODU0Mzg3NTY4MDYwMTE3ODUxOTE2MD%d"%stamp,"text":"%s"%message}}]}]}
|
|
175
|
+
elif type=="postback" and platform.upper() in ("FB_GROUP","FACEBOOK"):
|
|
176
|
+
t_time = stamp * 1000
|
|
177
|
+
body = {"object":"page","entry":[{"time":t_time,"id":"%s"%page_id,"messaging":[{"sender":{"id":"%s"%user_id},"recipient":{"id":"%s"%page_id},"timestamp":t_time,"postback":{"title":"继续 ➡️","payload":payload,"mid":"m_w6KNGd0PMndK0LvCw7Hzy1zsVSWT0fpN3ievQ9LtB0NxnnTQGDMyKI5DFeVbaJIRni1cqqJYXIJ-wq98aw%d"%stamp}}]}]}
|
|
167
178
|
url = "%s/facebook/webhook" % env
|
|
168
179
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
|
169
180
|
signData = sign_text.hexdigest()
|
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -723,6 +723,9 @@ def send_post_comment(data):
|
|
|
723
723
|
"""
|
|
724
724
|
#获取关联的贴文信息-第一则贴文
|
|
725
725
|
type = "post"
|
|
726
|
+
platform = "FACEBOOK"
|
|
727
|
+
if "platform" in data:
|
|
728
|
+
platform = data["platform"]
|
|
726
729
|
if "type" in data:
|
|
727
730
|
type = data["type"]
|
|
728
731
|
response = {}
|
|
@@ -734,6 +737,7 @@ def send_post_comment(data):
|
|
|
734
737
|
page_id = related_post_list["page_id"]
|
|
735
738
|
post_id = related_post_list["post_id"]
|
|
736
739
|
platform = related_post_list["platform"]
|
|
740
|
+
group_id = related_post_list["group_id"]
|
|
737
741
|
# print("请求的平台是",platform)
|
|
738
742
|
stamp = int(time.time())
|
|
739
743
|
num = random.randint(100000, 999999)
|
|
@@ -764,6 +768,17 @@ def send_post_comment(data):
|
|
|
764
768
|
body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {"from": {"id": user_id,
|
|
765
769
|
"username": name}, "media": {"id": post_id, "media_product_type": "FEED"},
|
|
766
770
|
"id": comment_id, "text": keyword}, "field": "comments"}]}], "object": "instagram"}
|
|
771
|
+
elif platform.upper() == "FB_GROUP":
|
|
772
|
+
t_time = stamp * 1000
|
|
773
|
+
post_id = post_id.split("_")[-1]
|
|
774
|
+
comment_id = "%d%d" % (stamp, num)
|
|
775
|
+
body = {"object": "page", "entry": [
|
|
776
|
+
{"id": page_id, "time": t_time, "messaging": [{"recipient": {"id": page_id}, "message": keyword,
|
|
777
|
+
"from": {"id": user_id, "name": name}, "group_id": group_id,
|
|
778
|
+
"post_id": post_id, "comment_id": comment_id,
|
|
779
|
+
"created_time": stamp, "item": "comment",
|
|
780
|
+
"verb": "add", "parent_id": post_id,
|
|
781
|
+
"field": "group_feed"}]}]}
|
|
767
782
|
|
|
768
783
|
url = "%s/facebook/webhook"%env
|
|
769
784
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.3.8 → sc-common-interface-2.3.9}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|