This commit is contained in:
parent
2a47b564d2
commit
3f533df14b
|
@ -267,7 +267,7 @@ def sunbw(N, opts=None):
|
||||||
opts['logger'].debug('pid: %s', pid)
|
opts['logger'].debug('pid: %s', pid)
|
||||||
opts['logger'].debug('oid: %s', oid)
|
opts['logger'].debug('oid: %s', oid)
|
||||||
xing, Str = generation(oname, opts=opts)
|
xing, Str = generation(oname, opts=opts)
|
||||||
opts['logger'].info(f'\t评价信息:{xing}星 ' + Str)
|
opts['logger'].info(f'评价信息:{xing}星 ' + Str)
|
||||||
# 获取图片
|
# 获取图片
|
||||||
url1 = (f'https://club.jd.com/discussion/getProductPageImageCommentList'
|
url1 = (f'https://club.jd.com/discussion/getProductPageImageCommentList'
|
||||||
f'.action?productId={pid}')
|
f'.action?productId={pid}')
|
||||||
|
@ -302,7 +302,7 @@ def sunbw(N, opts=None):
|
||||||
imgurl2 = imgdata["imgComments"]["imgList"][1]["imageUrl"]
|
imgurl2 = imgdata["imgComments"]["imgList"][1]["imageUrl"]
|
||||||
opts['logger'].debug('Image URL: %s', imgurl)
|
opts['logger'].debug('Image URL: %s', imgurl)
|
||||||
|
|
||||||
opts['logger'].info(f'\t图片:{imgurl + "," + imgurl2}')
|
opts['logger'].info(f'图片:{imgurl + "," + imgurl2}')
|
||||||
# 提交晒单
|
# 提交晒单
|
||||||
opts['logger'].debug('Preparing for commenting')
|
opts['logger'].debug('Preparing for commenting')
|
||||||
url2 = "https://club.jd.com/myJdcomments/saveProductComment.action"
|
url2 = "https://club.jd.com/myJdcomments/saveProductComment.action"
|
||||||
|
@ -325,7 +325,7 @@ def sunbw(N, opts=None):
|
||||||
opts['logger'].debug('Sending comment request')
|
opts['logger'].debug('Sending comment request')
|
||||||
pj2 = requests.post(url2, headers=headers, data=data)
|
pj2 = requests.post(url2, headers=headers, data=data)
|
||||||
if pj2.ok:
|
if pj2.ok:
|
||||||
opts['logger'].info(f'\t提交成功!')
|
opts['logger'].info(f'提交成功!')
|
||||||
else:
|
else:
|
||||||
opts['logger'].debug(
|
opts['logger'].debug(
|
||||||
'Skipped sending comment request in dry run')
|
'Skipped sending comment request in dry run')
|
||||||
|
@ -400,7 +400,7 @@ def review(N, opts=None):
|
||||||
opts['logger'].debug('oid: %s', oid)
|
opts['logger'].debug('oid: %s', oid)
|
||||||
opts['logger'].info(f'\t开始第{i+1}个订单: {oid}')
|
opts['logger'].info(f'\t开始第{i+1}个订单: {oid}')
|
||||||
_, context = generation(oname, _type=0, opts=opts)
|
_, context = generation(oname, _type=0, opts=opts)
|
||||||
opts['logger'].info(f'\t追评内容:{context}')
|
opts['logger'].info(f'追评内容:{context}')
|
||||||
data1 = {
|
data1 = {
|
||||||
'orderId': oid,
|
'orderId': oid,
|
||||||
'productId': pid,
|
'productId': pid,
|
||||||
|
@ -413,7 +413,7 @@ def review(N, opts=None):
|
||||||
opts['logger'].debug('Sending comment request')
|
opts['logger'].debug('Sending comment request')
|
||||||
req_url1 = requests.post(url1, headers=headers, data=data1)
|
req_url1 = requests.post(url1, headers=headers, data=data1)
|
||||||
if req_url1.ok:
|
if req_url1.ok:
|
||||||
opts['logger'].info(f'\t提交成功!')
|
opts['logger'].info(f'提交成功!')
|
||||||
else:
|
else:
|
||||||
opts['logger'].debug('Skipped sending comment request in dry run')
|
opts['logger'].debug('Skipped sending comment request in dry run')
|
||||||
opts['logger'].debug('Sleep time (s): %.1f', REVIEW_SLEEP_SEC)
|
opts['logger'].debug('Sleep time (s): %.1f', REVIEW_SLEEP_SEC)
|
||||||
|
@ -496,10 +496,10 @@ def Service_rating(N, opts=None):
|
||||||
opts['logger'].debug('Sending comment request')
|
opts['logger'].debug('Sending comment request')
|
||||||
pj1 = requests.post(url1, headers=headers, data=data1)
|
pj1 = requests.post(url1, headers=headers, data=data1)
|
||||||
if pj1.ok:
|
if pj1.ok:
|
||||||
opts['logger'].info(f'\t提交成功!')
|
opts['logger'].info(f'提交成功!')
|
||||||
else:
|
else:
|
||||||
opts['logger'].debug('Skipped sending comment request in dry run')
|
opts['logger'].debug('Skipped sending comment request in dry run')
|
||||||
opts['logger'].info("\t " + pj1.text)
|
#opts['logger'].info("\t " + pj1.text)
|
||||||
opts['logger'].debug('Sleep time (s): %.1f', SERVICE_RATING_SLEEP_SEC)
|
opts['logger'].debug('Sleep time (s): %.1f', SERVICE_RATING_SLEEP_SEC)
|
||||||
time.sleep(SERVICE_RATING_SLEEP_SEC)
|
time.sleep(SERVICE_RATING_SLEEP_SEC)
|
||||||
N['服务评价'] -= 1
|
N['服务评价'] -= 1
|
||||||
|
|
Loading…
Reference in New Issue