Skip to content

Commit 59e0821

Browse files
committed
disable AQI queries
1 parent 03918a4 commit 59e0821

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.eleventy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ module.exports = function (eleventyConfig) {
9292
// currently this only returns an HTML widget that
9393
// shows the aqi for Mumbai, though this could easily be changed
9494
eleventyConfig.addAsyncShortcode("aqi", async (location) => {
95+
const fallback = `<table align=center><tr><td>⚠️ failed to retrieve AQI reading for ${location.toUpperCase()} ⚠️</td></tr></table>`;
96+
return fallback;
9597
console.log(`[cyberb] pulling AQI data for ${location}`);
9698
const { statusCode, body } = await request(
9799
"https://airnowgovapi.com/reportingarea/get",
@@ -104,7 +106,6 @@ module.exports = function (eleventyConfig) {
104106
},
105107
);
106108

107-
const fallback = `<table align=center><tr><td>⚠️ failed to retrieve AQI reading for ${location.toUpperCase()} ⚠️</td></tr></table>`;
108109
if (statusCode !== 200) {
109110
console.log(`[cyberb] AQI data call failed with error ${statusCode}`);
110111
return fallback;

0 commit comments

Comments
 (0)