sc-common-interface 2.6.8__tar.gz → 2.7.0__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
- Name: sc-common-interface
3
- Version: 2.6.8
2
+ Name: sc_common_interface
3
+ Version: 2.7.0
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -268,7 +268,7 @@ def send__live_comment(data):
268
268
  if "-" in post_id:
269
269
  post_id = post_id.split("_")[-1]
270
270
  else:
271
- print("----")
271
+ # print("----")
272
272
  relationUrl = data["relationUrl"]
273
273
  match = re.search(r'groups/(\d+)/posts/(\d+)/', relationUrl)
274
274
  group_id = match.group(1)
@@ -278,14 +278,14 @@ def send__live_comment(data):
278
278
  "from":{"id":user_id,"name":name},"group_id":group_id,"post_id":post_id,"comment_id":comment_id,"created_time":stamp,"item":"comment",
279
279
  "verb":"add","parent_id":post_id,"field":"group_feed"}]}]}
280
280
 
281
- print(body)
281
+ # print(body)
282
282
  url = "%s/facebook/webhook" % env
283
283
  sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
284
284
  signData = sign_text.hexdigest()
285
285
  # print("body", json.dumps(body))
286
286
  header = {"Content-Type": "application/json", "x-hub-signature": "sha1=%s" % signData}
287
287
  response = requests.post(url, headers=header, data=json.dumps(body))
288
- print(response.text)
288
+ # print(response.text)
289
289
  return user_id, name, comment_id
290
290
 
291
291
  def send_mc_message(data):
@@ -349,7 +349,7 @@ def send_mc_message(data):
349
349
  header = {"Content-Type": "application/json", "x-hub-signature": "sha1=%s" % signData}
350
350
  response = requests.post(url, headers=header, data=json.dumps(body))
351
351
  # print(response.text)
352
- print(body)
352
+ # print(body)
353
353
  return user_id, name
354
354
 
355
355
 
@@ -370,7 +370,7 @@ def get_live_info(data):
370
370
  else:
371
371
  count=count+1
372
372
  if count>10:
373
- print("查询报错")
373
+ print("查询报错:",response)
374
374
  return response
375
375
 
376
376
 
@@ -2005,10 +2005,7 @@ if __name__=="__main__":
2005
2005
  sales_id= create_live(data)
2006
2006
  data["sales_id"] = sales_id
2007
2007
  delete_relate_post(data)
2008
- add_live(data)
2009
- data["key"] = "5e3bba98882fc0fb22a0607238bc5b8f"
2010
- del data["post_id"]
2011
- send__live_comment(data)
2008
+
2012
2009
 
2013
2010
 
2014
2011
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.6.8
3
+ Version: 2.7.0
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -1,8 +1,8 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
- name='sc-common-interface',
5
- version='2.6.8',
4
+ name='sc_common_interface',
5
+ version='2.7.0',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),