博客園批量發閃存,獲取小星星
阿新 • • 發佈:2018-08-07
效果 webkit htm log 閃存 del connect int 刪掉
初步實現代碼如下,如果沒有小星星,則調下刪除的接口來刪掉
# -*- coding:utf-8 -*- # __author__ :kusy # __content__:文件說明 # __date__:2018/8/7 16:08 import requests import time def str2json(str,convStr=‘\n‘): d = {} for s in str.split(convStr): s = s.lstrip() if s != ‘‘: subS = s.split(‘:‘) d[subS[0]] = subS[1].lstrip() return d url_add = ‘https://ing.cnblogs.com/ajax/ing/Publish‘ url_del = ‘https://ing.cnblogs.com/ajax/ing/del‘ data_add ={‘content‘:u‘小星星‘,‘publicFlag‘:‘1‘} data_del ={‘ingId‘:‘1412227‘} headers = str2json( ‘‘‘ Connection: keep-alive Accept: application/json, text/javascript, */*; q=0.01 Origin: https://ing.cnblogs.com X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Content-Type: application/x-www-form-urlencoded Referer: https://ing.cnblogs.com/ Accept-Language: zh-CN,zh;q=0.8‘‘‘ ) headers[‘Cookie‘]=‘__guid=46247039.1954902115310474800.1510794105810.6067; 略。。。‘ for i in range(10,100,1): data_add[‘content‘] = u‘小星星‘ + str(i) r = requests.post(url=url_add,data=data_add,headers=headers) print(r.status_code , r.content.decode(‘utf-8‘)) time.sleep(100)
for i in range(5): data_del[‘ingId‘] = 1412328 + (i + 1) r = requests.post(url=url_del,data=data_del,headers=headers) print(r.status_code , r.content.decode(‘utf-8‘))
效果如下(貌似都沒有小星星):
博客園批量發閃存,獲取小星星