8000 weather.sh: add User-Agent header to avoid 403 from api.met.no · Issue #499 · erikw/tmux-powerline · GitHub
[go: up one dir, main page]

Skip to content

weather.sh: add User-Agent header to avoid 403 from api.met.no #499

@kamidzuua

Description

@kamidzuua

The weather.sh segment currently calls:

curl -s "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=$lat&lon=$lon"

without any custom User-Agent header.

Since late 2023, api.met.no strictly enforces a requirement for an identifying User-Agent.
Requests without one now return HTTP 403 and can cause temporary IP bans.

Proposed fix:

  • Add a -H "User-Agent: ..." option (defaulting to "tmux-powerline/<version> (<github url>)")
  • Or allow override via TMUX_POWERLINE_SEG_WEATHER_USER_AGENT environment variable.

Reference:
https://api.met.no/doc/TermsOfService

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0