Extract links in sitemap and automatically push them to search engines using Baidu, Bing, and Google APIs to improve the speed of website inclusion.
Please do not fork this warehouse! ! Use template to import Use this template!! Send spam PR by clicking the fork button and submitting it directly to the GitHub blacklist)
Modify the value of site in the generate.py file to your blog address and the value of sitemaps variable to your sitemap.xml address. Please make sure your sitemap is in normal format.
site = 'https://blog.xxx.cn'
sitemaps = [ '/sitemap1.xml' , '/sitemap2.xml' ] First, go to Baidu resource search platform to obtain token , which is the string after API submission, the interface call address http://data.zz.baidu.com/urls?site=xxx&token=xxx , token= .
fork this repository, Settings > Secrets > new New secret , fill in BAIDUTOKEN in Name , Value what you just obtained. (Putting it in Secrets can prevent token leakage). Create a new secret, name is site , and Value is your blog address. The protocol header is required, and the end cannot have /
Okay, the task is done. Next, GitHub will automatically push links to Baidu every day.
Top 50 URLs per day + 50 URLs randomly
Go to https://www.bing.com/webmasters,设置-> API 访问-> API 密钥-> 新建
Settings > Secrets > new New secret , fill in BINGTOKEN in Name , fill in Value with the newly created key
The first 5 URLs per day + 5 random URLs
First, you need to set access to the Indexing API in Google Cloud Platform - follow the instructions below.
https://developers.google.com/search/apis/indexing-api/v3/prereqs
Once you have access to the index API, you can download the public/private key pair JSON file that contains all your credentials and should be saved as "service_account.json".
Settings > Secrets > new New secret , fill in GOOGLE_SERVICE_ACCOUNT in Name , fill in the newly created key Value
In this step, you will verify that you have control over your network assets.
To verify ownership of your website, you need to add your service account email address (see service_account.json - client_email) and add it as the owner of the web property in Search Console ("Delegation").
You can find your service account email address in two places:
Then...
1. Go to Google Webmaster Center
2. Click on your verified resource
3. Scroll down and click "Add Owner".
4. Add your service account email address to the resource as the owner of the resource.
Top 50 URLs per day + 50 URLs randomly
Enjoy it!