Skip to content

Create a randomized User-Agent utility #43

Description

@Himish04

Description:

Our fetchers in 'fetchers/' directory pulls from aggregators (Bigevent, dev.events, papercall.io, sessionize.com) plus the hardcoded flagship watchlist, using standard Python requests. Some of these calls have hardcoded Chrome User-Agents, others have none. Running this nightly via GitHub Actions will eventually get us blocked with 429 Too Many Requests by Cloudflare or similar.

Tasks:

  • Create a shared utility module (e.g. utils/user_agents.py) containing an array of 10-15 modern, real-world browser User-Agent strings (Chrome, Firefox, Safari, Edge — mix of desktop/mobile)
  • Export a function (e.g. get_random_user_agent()) that returns a random one using random.choice()
  • Update every aggregator scraper (Bigevent, dev.events, papercall.io, sessionize.com, flagship watchlist fetcher) to use this function for outbound requests calls instead of hardcoded or missing User-Agent headers
  • Leave Playwright/Browserless-driven scrapers alone if they already set their own UA — this utility is for the plain requests-based aggregator scrapers
  • Confirm the nightly GitHub Actions workflow still runs cleanly after the change
  • Document the utility in CONTRIBUTING so new aggregator scrapers use it by default

To claim: comment below so we don't get duplicate work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions