In this tutorial I'll show you how you can check multiple links with a Google Spreadsheet and a simple Google Apps Script.
You may find this article useful if you have a lot of links and want to find broken ones, or for example, if you are testing some API endpoints with different parameters, headers, or body and want to check http responses.
Spreadsheet Google Apps Script:
https://docs.google.com/spreadsheets/d/1UyuKCRO8BWcIaluGEYTuUZglBryo0uFBji2a6tbBXCw/copy
Github Page:
https://github.com/Vryntel/Spreadsheet-Url-Tester
The spreadsheet is composed by 2 sheet:
The Data sheet use the following columns:
Example:
URL: https://mywebsite.com
PARAMS: {"param1":"test", "params2":"test2"}
FETCHED URL: https://mywebsite.com?param1=test¶m2=test2
In the Settings sheet you can edit some adavnced settings of the HTTP requests:
After making a copy of the spreadsheet, in the top toolbar will appear the option "Url Tester" and then "Test Urls" (if it doesn't appear try to reload the page).
To run the script you need to click Test Urls option. Only the first time it will ask you to grant permission for the script to be executed.
If you only need to use the spreadsheet to check for broken links, you can use only the column A to insert the links and in the column B you can leave the GET method for each url row. When you run the script, the response code will appear in the column G and if it's OK it will be printed the code 200, otherwise another code, you can see all possible codes here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
Some notes:
https://developers.google.com/apps-script/guides/services/quotas
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3