GithubHelp home page GithubHelp logo

baidu-push's Introduction

baidu-url-submit-by-using-sitemap

它可以干嘛

提取 sitemap 中的链接,并自动利用百度 API 进行推送,提升网站收录速度。

它的由来

博客从 Hexo 换到 Gridsome,没有相应的插件可以生产链接并推送至百度,于是就自己利用 Python 和 GitHub Action 写了一个自动推送。任何博客框架都可以用,只需要配置好,就可以每天自动利用百度的 API 进行链接提交。

它要怎么用

先前往百度资源搜索平台获取 token,就是 API 提交中,接口调用地址 http://data.zz.baidu.com/urls?site=xxx&token=xxxtoken= 之后的那一串。

fork 本仓库,Settings > Secrets > new New secretName 中填写 BAIDUTOKENValue 即刚刚获取的。(放入 Secrets 中能防止 token 泄露)。再新建一个 secret,namesiteValue 为你的博客地址,需要协议头,结尾不能有 /

generate.py 文件中 sitemap 变量的值修改为你的 sitemap.xml 地址,请确保你的 sitemap 为正常格式。

sitemap = 'https://blog.jalenchuh.cn/sitemap.xml'

好了,大功告成,接下来每天北京时间 0 点左右,GitHub 便会自动帮你推送链接至百度。

如果你配置完成后迫不及待想要查看结果,可以试着给你的仓库点个🌟(当然也别忘了给本仓库也来个🌟),之后便可进入 GitHub Acion 中查看结果。

Enjoy it!


🚀 baidu-url-submit-by-using-sitemap ©Jalen Chuh. Released under the MIT License.

Authored and maintained by Jalen Chuh.

@Portfolio · @Blog · @GitHub

baidu-push's People

Contributors

colsrch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.