首页 > 其他 > 详细

批量链接自动推送和周推送

时间:2019-07-30 15:46:44      阅读:66      评论:0      收藏:0      [点我收藏+]
import requests, time


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())

 

批量链接自动推送和周推送

原文:https://www.cnblogs.com/mana66ccff/p/seo.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!