zoukankan      html  css  js  c++  java
  • 批量链接自动推送和周推送

    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())
  • 相关阅读:
    Python基础07
    python基础06
    python基础05
    python基础04
    python基础03
    python基础02
    python组件之wtforms
    PythonWeb框架之Flask
    Linux下yum安装Redis
    在vuex的mutations中使用vue的小技巧
  • 原文地址:https://www.cnblogs.com/mana66ccff/p/seo.html
Copyright © 2011-2022 走看看