sc-common-interface 2.3.2__tar.gz → 2.3.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -88,16 +88,22 @@ def send__live_comment(data):
88
88
  keyword = "接口测试普通留言"
89
89
  if "keyword" in data:
90
90
  keyword = data['keyword']
91
- body = {}
92
- if platform == "FACEBOOK":
93
- body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
91
+ body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
94
92
  "from": {"id": user_id, "name": name},
95
93
  "post": {"status_type": "added_video", "is_published": True, "updated_time": "2022-11-18T09:57:26+0000",
96
94
  "permalink_url": "https://www.facebook.com/permalink.php?story_fbid=pfbid02jLK3e6YdFSXp2DmD7j7vtStLXoBzTi8rxKrp6jFhVMUTTEgz6qvZA8soR9Uwydd8l&id=107977035056574",
97
95
  "promotion_status": "inactive", "id": post_id}, "message": keyword, "item": "comment",
98
96
  "verb": "add", "post_id": post_id, "comment_id": comment_id,
99
97
  "created_time": stamp, "parent_id": post_id}}]}]}
100
- elif platform == "INSTAGRAM":
98
+ # if platform == "FACEBOOK":
99
+ # body = {"object": "page", "entry": [{"id": page_id, "time": stamp, "changes": [{"field": "feed", "value": {
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":
101
107
  body = {"entry": [{"id": page_id, "time": stamp, "changes": [{"value": {"from": {"id": user_id,
102
108
  "username": name},
103
109
  "media": {"id": post_id,
@@ -139,12 +145,18 @@ def send_mc_message(data):
139
145
  i = platform_list.index(platform)
140
146
  page_id = info["data"]["relatedPostList"][i]["page_id"]
141
147
  platform = info["data"]["relatedPostList"][i]["platform"]
142
- body = {}
143
- if platform.upper()=="FACEBOOK":
144
- body = {"entry":[{"id":"%s"%page_id,"messaging":[{"message":
145
- {"mid":"m_hhAqPhSlMTY4En2oWjSB59T3BFjeU97DdDV4WHr3DLWnPrO0iCsjQlG3hBN%d-sBlT26-6oNg"%stamp,"text":"%s"%message},
146
- "recipient":{"id":"%s"%page_id},"sender":{"id":"%s"%user_id},"timestamp":stamp}],"time":stamp}],"object":"page"}
147
- elif platform.upper()=="INSTAGRAM":
148
+ body = {"entry": [{"id": "%s" % page_id, "messaging": [{"message":
149
+ {
150
+ "mid": "m_hhAqPhSlMTY4En2oWjSB59T3BFjeU97DdDV4WHr3DLWnPrO0iCsjQlG3hBN%d-sBlT26-6oNg" % stamp,
151
+ "text": "%s" % message},
152
+ "recipient": {"id": "%s" % page_id},
153
+ "sender": {"id": "%s" % user_id}, "timestamp": stamp}],
154
+ "time": stamp}], "object": "page"}
155
+ # if platform.upper()=="FACEBOOK":
156
+ # body = {"entry":[{"id":"%s"%page_id,"messaging":[{"message":
157
+ # {"mid":"m_hhAqPhSlMTY4En2oWjSB59T3BFjeU97DdDV4WHr3DLWnPrO0iCsjQlG3hBN%d-sBlT26-6oNg"%stamp,"text":"%s"%message},
158
+ # "recipient":{"id":"%s"%page_id},"sender":{"id":"%s"%user_id},"timestamp":stamp}],"time":stamp}],"object":"page"}
159
+ if platform.upper()=="INSTAGRAM":
148
160
  body={"object":"instagram","entry":[{"time":stamp,"id":"%s"%page_id,"messaging":[{"sender":{"id":"%s"%user_id},"recipient":{"id":"%s"%page_id},
149
161
  "timestamp":stamp,"message":{"mid":"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwMzgwODgwNTMzOjM0MDI4MjM2Njg0MTcxMDMwMTI0NDI3NjAyNDExMzcwMDc2NTA5MDozMTgzODU0Mzg3NTY4MDYwMTE3ODUxOTE2MD%d"%stamp,"text":"%s"%message}}]}]}
150
162
  url = "%s/facebook/webhook" % env
@@ -347,7 +359,7 @@ def get_broadcast_list(data):
347
359
  for i,value in enumerate(name_list):
348
360
  if value==name:
349
361
  broadcast_id =broadcast_id_list[i]
350
- return broadcast_id,name
362
+ return broadcast_id,reponse
351
363
 
352
364
  def get_broadcast_detail(data):
353
365
  env = data["env"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc-common-interface',
5
- version='2.3.2',
5
+ version='2.3.3',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),