The submit_urls.py
Python script refers to the sitemap and submits the URLs
of newer entries than the last submission through the Indexing
API and
the Bing Webmaster API.
submit_urls.py
has been tested for Blogger on Debian Testing on WSL 2 and
requires the following packages:
google-api-python-client
to access Google APIspandas
to extract updated URLs from the sitemappython-gnupg
to invoke GnuPG for decrypting your encrypted JSON key file and API key file for authorizationxmltodict
to convert the sitemap to a dictionary
Install each package as needed. For example:
sudo apt install gpg
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt -U
submit_urls.py
will create a ~/.config/submit-urls/submit_urls.ini
configuration file if it does not already exist.
First, prepare your JSON key file for the Indexing API and API key file for the Bing Webmaster API, and encrypt them using GnuPG with your OpenPGP key pair. Next, replace the values of the following options in the configuration file with your own:
sitemap_url
json_key_path
api_key_path
Then, execute:
submit_urls.py
-n
: do not perform POST requests-B [OUTPUT_DIRECTORY]
: generate a Bash script to launch this script and exit
- Bash Scripting to Submit Appropriate URLs through Bing Webmaster API: a blog post providing background on the original Bash script, now implemented in Python