Glanceway Glanceway
All sources

Earthquake Alerts

News v1.0.0

Recent significant earthquakes worldwide from USGS

@codytseng #earthquake #alerts #science

Install and configure this source

  1. Install Glanceway and open it on your Mac before using the install link above.
  2. Choose Install in Glanceway. If the browser cannot open the app, download the .gwsrc file and import it through source management.
  3. Complete the required fields below, save, and choose a refresh interval. Check the source after its first successful fetch.

Configuration checklist

  • MIN_MAGNITUDE — Optional. Minimum earthquake magnitude to display
  • TIME_RANGE — Optional. Time range for earthquake data

If items are missing

  • Verify the field names, list entries, and credentials against the current version’s configuration table. Sample values below are examples, not active credentials.
  • Check network access and upstream service availability. Authentication failures and rate limits can prevent a refresh; use a slower interval when the provider limits requests.
  • An empty result can also mean there are no matching items. Fetched content and update timing depend on the provider and source implementation.

Configuration

Name Key Type Required Default Description
Min Magnitude MIN_MAGNITUDE select No 4.5 Minimum earthquake magnitude to display
significant4.52.51.0all
Time Range TIME_RANGE select No day Time range for earthquake data
hourdayweekmonth

Source Code

id: codytseng/earthquake-usgs
version: 1.0.0
name: Earthquake Alerts
description: Recent significant earthquakes worldwide from USGS
author: codytseng
author_url: https://github.com/codytseng
category: News
tags:
  - earthquake
  - alerts
  - science

config:
  - key: MIN_MAGNITUDE
    name: Min Magnitude
    type: select
    required: false
    default: "4.5"
    description: Minimum earthquake magnitude to display
    options:
      - significant
      - "4.5"
      - "2.5"
      - "1.0"
      - all
  - key: TIME_RANGE
    name: Time Range
    type: select
    required: false
    default: day
    description: Time range for earthquake data
    options:
      - hour
      - day
      - week
      - month
module.exports = async (api) => {
  const minMagnitude = api.config.get("MIN_MAGNITUDE") || "4.5";
  const timeRange = api.config.get("TIME_RANGE") || "day";

  async function fetchData() {
    const res = await api.fetch(
      `https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/${minMagnitude}_${timeRange}.geojson`,
    );
    if (!res.ok || !res.json) {
      throw new Error(`Failed to fetch earthquake data (HTTP ${res.status})`);
    }

    const items = res.json.features.map((feature) => ({
      id: feature.id,
      title: feature.properties.title,
      subtitle: feature.properties.place,
      url: feature.properties.url,
      timestamp: feature.properties.time,
    }));

    api.emit(items);
  }

  await fetchData();

  return {
    refresh: fetchData,
  };
};

Related Sources