In this tutorial I'll show you how you can check multiple links with a Google Check Links with 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.
Check Links with Google Spreadsheet + Google Apps Script:
https://docs.google.com/spreadsheets/d/1UyuKCRO8BWcIaluGEYTuUZglBryo0uFBji2a6tbBXCw/copy
Github Page:
https://github.com/Vryntel/Check Links with Google 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
The above is the detailed content of Check Links with Google Spreadsheet. For more information, please follow other related articles on the PHP Chinese website!