← all conversations

Real-time metrics via RSS

2025-07-0415 turns5,480 charsgpt-4o
real-time-metricsrssllm-prompts

Summary

User wants to fetch real-time metrics via RSS using Python for use as variables in LLM prompts within a developer environment.

Messages

what are all the real time metrics which can be fetched easily through RSS with a python script that allows you to include these as variables in the construction of LLM prompts in a developer environment
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
⚙ model reasoning step
gpt-4o
Below is a developer-oriented “menu” of **real-time or near-real-time metrics that are already exposed through public RSS / Atom / GeoRSS feeds**. Each entry lists * **What you get** – the kind of value you can turn into a prompt variable * **Typical cadence** – how fast the feed refreshes * **Example feed URL (or family of URLs)** – so you can test with `feedparser` right away Feel free to copy the variable names verbatim or adapt them to your own templating system. --- ### 1. Geophysical & environmental | Variable | What you capture | Cadence | Example feed | |---|---|---|---| | `earthquake_mag`, `earthquake_place` | Magnitude + location of latest quake | Seconds to minutes | Any USGS “All earthquakes — last hour” Atom: `https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.atom` citeturn3view0 | | `weather_alert_type`, `weather_alert_area` | NWS warnings (tornado, flash-flood etc.) | ≤ 1 min | NWS CAP national feed: `https://alerts.weather.gov/cap/us.php?x=1` citeturn4view0 | | `hurricane_name`, `hurricane_status` | Active tropical cyclone advisories | 6 h (or faster during events) | NHC RSS: `https://www.nhc.noaa.gov/xml/TAL.xml` (Atlantic) citeturn4view0 | | `aqi_value`, `aqi_category` | Local Air Quality Index | Hourly | AirNow EnviroFlash city feed: `https://feeds.enviroflash.info/rss/realtime/{CITY_CODE}.xml` citeturn10search0 | | `energy_report_title` | Headline metrics on oil, gas, power | Weekly / daily | EIA “Weekly Petroleum Status Report” feed: `https://www.eia.gov/rss/?src=wpsr` citeturn5view0 | ### 2. Finance & crypto | Variable | What you capture | Cadence | Example feed | |---|---|---|---| | `btc_price_usd` | Last Bitcoin Price Index tick (headline) | ~1 min | CoinDesk news/price summary feed: `https://www.coindesk.com/arc/outboundfeeds/rss/` (title text includes live price) citeturn6search1 | | `energy_headline` | “Today in Energy” snapshot (oil, gas, renewables) | Daily | `https://www.eia.gov/rss/feeds/today_in_energy.xml` citeturn5view0 | | `fed_release` | Latest FOMC / policy release blurb | Ad-hoc minutes | Federal Reserve RSS: `https://www.federalreserve.gov/feeds/press_all.xml` citeturn2search1 | *(For tick-level quotes you’ll usually jump to JSON/web-socket APIs; RSS works best for skimmable headline metrics.)* ### 3. Sports & entertainment | Variable | What you capture | Cadence | Example feed | |---|---|---|---| | `nba_headline` | Latest NBA scoreboard / game recap title | Minutes | ESPN NBA top headlines: `https://www.espn.com/espn/rss/nba/news` citeturn8search3 | | `team_alert` | Injury / roster changes | Minutes | Same ESPN feed family – pick sport or team | ### 4. Transportation & aviation | Variable | What you capture | Cadence | Example feed | |---|---|---|---| | `faa_update_title` | National Airspace System or airport advisories | Minutes to hours | FAA press-release / system-status feed: `https://www.faa.gov/newsroom/press_releases?format=RSS` citeturn9search8 | | `mta_status` | NYC subway/bus planned or real-time outage text | Minutes | `http://www.mta.info/status/service_status_rss_4.xml` (subway) citeturn1search2 | --- ## Minimal Python pattern ```python import feedparser, re, datetime as dt FEEDS = { "earthquake": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.atom", "weather_alerts": "https://alerts.weather.gov/cap/us.php?x=1", "btc": "https://www.coindesk.com/arc/outboundfeeds/rss/" } def latest_entry(url): feed = feedparser.parse(url) return feed.entries[0] if feed.entries else None variables = {} eq = latest_entry(FEEDS["earthquake"]) if eq: variables["earthquake_mag"] = float(eq.title.split(" ")[1]) variables["earthquake_place"] = " ".join(eq.title.split(" ")[2:]) weather = latest_entry(FEEDS["weather_alerts"]) if weather: variables["weather_alert_type"] = weather.title variables["weather_alert_area"] = weather.cap_areadesc btc = latest_entry(FEEDS["btc"]) if btc: m = re.search(r'\$([\d,]+\.\d+)', btc.title) variables["btc_price_usd"] = float(m.group(1).replace(",", "")) if m else None print(variables) ``` You can now inject `variables` straight into a prompt, e.g.: ```python prompt = f""" As of {dt.datetime.utcnow():%Y-%m-%d %H:%MZ}, BTC is ${variables['btc_price_usd']}, and the most recent USGS event was a magnitude {variables['earthquake_mag']} near {variables['earthquake_place']}. Write a calm market-wrap tweet in 140 characters that also warns followers of any current NWS alerts: {variables['weather_alert_type']} for {variables['weather_alert_area']}. """ ``` ### Tips 1. **Use feedparser’s `.updated_parsed` timestamp** to guard against stale data. 2. **Cache feed URLs** in memory or on disk; polling every 30–60 s per feed is polite. 3. Most feeds include either `<geo:lat>`/`<geo:long>` or CAP/GeoRSS extensions—perfect for location-aware prompts. 4. If you need *structured* numbers (e.g., OHLC prices) switch to the provider’s JSON API and fall back on RSS for headline context. RSS remains a quick, dependency-free way to add live context to LLM prompts—especially for event-driven text (alerts, releases, headlines) where the *title* or *summary* already carries the metric you want.
gpt-4o