sc-common-interface 2.0.9__tar.gz → 2.1.2__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.0.9 → sc-common-interface-2.1.2}/PKG-INFO +1 -1
- sc-common-interface-2.1.2/sc_common_interface/Platform.py +7 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface/PostCommonInterface.py +30 -11
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/SOURCES.txt +1 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/setup.py +1 -1
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/setup.cfg +0 -0
{sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface/PostCommonInterface.py
RENAMED
|
@@ -8,6 +8,8 @@ import random
|
|
|
8
8
|
import hmac
|
|
9
9
|
from hashlib import sha1
|
|
10
10
|
import random
|
|
11
|
+
from Platform import Platform
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
platform = "FACEBOOK"
|
|
@@ -347,28 +349,42 @@ def get_page_post(data):
|
|
|
347
349
|
fb group:GROUP_POST
|
|
348
350
|
:return:响应
|
|
349
351
|
"""
|
|
352
|
+
#时间戳转换
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
350
356
|
env = data["env"]
|
|
351
357
|
headers = data["headers"]
|
|
352
358
|
platform = "FACEBOOK"
|
|
359
|
+
type = "POST"
|
|
360
|
+
days = 180
|
|
361
|
+
current_time = datetime.datetime.now()
|
|
362
|
+
since = int((current_time - datetime.timedelta(days=days)).timestamp())
|
|
363
|
+
if "type" in data:
|
|
364
|
+
type = data["type"]
|
|
353
365
|
if "platform" in data:
|
|
354
366
|
platform = data["platform"].upper()
|
|
355
367
|
if "page_id" in data:
|
|
356
368
|
page_id = data["page_id"]
|
|
357
369
|
else:
|
|
358
370
|
page_id, page_name, group_id = get_channel_info(data)
|
|
359
|
-
if platform==
|
|
371
|
+
if platform==Platform.FB_GROUP.name:
|
|
360
372
|
page_id = group_id
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
373
|
+
type = "GROUP_POST"
|
|
374
|
+
since = int((current_time - datetime.timedelta(days=7)).timestamp())
|
|
375
|
+
if "days" in data:
|
|
376
|
+
days = data["days"]
|
|
377
|
+
since = int((current_time - datetime.timedelta(days=int(days))).timestamp())
|
|
378
|
+
|
|
379
|
+
# since = 1699027200
|
|
380
|
+
# if "since" in data:
|
|
381
|
+
# since = data["since"]
|
|
367
382
|
page_size = 50
|
|
368
383
|
if "page_size" in data:
|
|
369
384
|
page_size = data
|
|
370
385
|
params = {"page_size":page_size,"type":type,"since":since,"party_channel_id":page_id,"platform":platform}
|
|
371
386
|
url = "%s/api/posts/post"%env
|
|
387
|
+
print("params",params)
|
|
372
388
|
response =requests.get(url,headers=headers,params=params).json()
|
|
373
389
|
return response
|
|
374
390
|
|
|
@@ -1147,7 +1163,7 @@ def modify_message(data):
|
|
|
1147
1163
|
headers = data["headers"]
|
|
1148
1164
|
sales_id = data["sales_id"]
|
|
1149
1165
|
|
|
1150
|
-
url = "api/posts/post/sales/%s/keyword_message"%sales_id
|
|
1166
|
+
url = "%s/api/posts/post/sales/%s/keyword_message"%(env,sales_id)
|
|
1151
1167
|
need_send_message = True
|
|
1152
1168
|
if "need_send_message" in data:
|
|
1153
1169
|
need_send_message = data["need_send_message"]
|
|
@@ -1304,7 +1320,10 @@ def end_post(data):
|
|
|
1304
1320
|
|
|
1305
1321
|
|
|
1306
1322
|
if __name__=="__main__":
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1323
|
+
data = {'env': 'https://front-admin.shoplineapp.com', 'headers': {'Content-Type': 'application/json',
|
|
1324
|
+
'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI3YjdiM2E1MzU4M2IwYzlhZGVhODkyZDY3OTJlNTNlMSIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MWIwOTZiZWI3YmVmMTAwMjQ1ZGJkOGIiLCJhcHBsaWNhdGlvbl9pZCI6IjYyN2M3NTBhMDYyMzcwMDAwYWZlNWVmZCJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMuc2hvcGxpbmVhcHAuY29tIiwiYXVkIjpbXSwic3ViIjoiNjFiMDk2YmViN2JlZjEwMDI0NWRiZDhiIn0.mkq54BMp-20y8oiw0qc9caeUzH-vT6oRkeUCpZrt1jI',
|
|
1325
|
+
'lang': 'en'}, 'platform': 'FACBOOK',
|
|
1326
|
+
'patternModel': 'INCLUDE_MATCH', 'title': 'river接口自动化测试搜索贴文销售列表使用', "sales_id": 68242}
|
|
1327
|
+
response = modify_message(data)
|
|
1328
|
+
print(response)
|
|
1310
1329
|
|
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.0.9 → sc-common-interface-2.1.2}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|