Bash scripts that refer to the sitemap and submit the URLs of newer entries than the last submission through the Bing Webmaster API or Yandex.Webmaster API.
These scripts have been tested for Blogger on Debian bullseye on WSL 1 and use the following packages:
- curl to retrieve the sitemap and submit URLs
- xq included in the yq package to transcode XML to JSON
- jq to filter JSON data
- GnuPG to encrypt the configuration file
Install each package as needed. For example:
sudo apt install curl
pip install yq
sudo apt install jq
sudo apt install gpg
Make sure that Bash can find these scripts in the directories of the
PATH
. For example:
PATH=$HOME/path/to/submit-urls:$PATH
or
cp -i *.sh ~/.local/bin
If the configuration file ~/.config/SCRIPT_BASENAME.cfg.gpg
does not
exist, the following scripts will create and encrypt it assuming that
the default key of GnuPG is your OpenPGP key pair.
Prepare an API key for authorization, and replace the values of the following variables in the configuration file with yours:
SITEMAP
SITE_URL
API_KEY
Then:
submit-urls-bing.sh
Prepare an access token, user ID, and host ID for authorization and using the API, and replace the values of the following variables in the configuration file with yours:
SITEMAP
access_token
USER_ID
HOST_ID
Then:
submit-urls-yandex.sh
-n
(dry run) retrieves the sitemap and shows newer entries than the last submission but does not submit them.-s
(silent) does not show any output except for an error message from curl.
The script submit-urls-yandex.sh
repeats a request for each URL
because the queue
method
of the API does not seem to support arrays.
Blog posts for more details: