使用Python做的一个链接批量推送脚本,主要是用于网站的主动推送和天级推送。
Python链接推送脚本:
import requests, time #www.daxianseo.cn def postbaidu_week(url): try: html = requests.post("天级(周级)api", data=url, timeout=5).json() if html['success'] > 0: print("成功推送.........{}".format(html)) else: print("失败推送........{}".format(html)) except Exception as e: print(e) postbaidu_week(url) def pingandpostbaidu(url): try: html = requests.post("主动推送api", data=url, timeout=5).json() if html['success'] > 0: print("成功推送.........{}".format(html)) else: print("失败推送........{}".format(html)) # 同时推送至天推送 postbaidu_week(url) except Exception as e: print(e) pingandpostbaidu(url) if __name__ == '__main__': for url in open("未收录地址.txt",encoding='utf-8', newline='').readlines(): pingandpostbaidu(url.strip())
链接推送的效果如图:
微信赞赏
支付宝赞赏