{"id":51175328,"url":"https://github.com/thunderbird/aaq-scraper","last_synced_at":"2026-06-27T03:05:25.637Z","repository":{"id":367458335,"uuid":"1280829414","full_name":"thunderbird/aaq-scraper","owner":"thunderbird","description":"until we get an official API that has a way to prevent DOS-ing maybe we can scrape the API by being a browser?","archived":false,"fork":false,"pushed_at":"2026-06-26T04:11:32.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-26T05:23:11.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thunderbird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-26T01:26:43.000Z","updated_at":"2026-06-26T04:11:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thunderbird/aaq-scraper","commit_stats":null,"previous_names":["thunderbird/aaq-scraper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/thunderbird/aaq-scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderbird%2Faaq-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderbird%2Faaq-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderbird%2Faaq-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderbird%2Faaq-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunderbird","download_url":"https://codeload.github.com/thunderbird/aaq-scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunderbird%2Faaq-scraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34839935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-27T03:05:21.996Z","updated_at":"2026-06-27T03:05:25.629Z","avatar_url":"https://github.com/thunderbird.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aaq-scraper\n\nUntil we get an official API that has a way to prevent DOS-ing, we scrape the SUMO\n(support.mozilla.org) API by driving a real browser. Since ~June 2026 the API sits\nbehind a JavaScript challenge that blocks headless HTTP (see\n[thunderbird/github-action-thunderbird-aaq#34](https://github.com/thunderbird/github-action-thunderbird-aaq/issues/34));\na real browser passes the challenge, then we call the JSON API from inside the\nbrowser's authenticated context.\n\n## Proof of concept (Bucket 0)\n\n```sh\nuv sync\nuv run playwright install chromium\nuv run python poc.py            # headed — most likely to pass the challenge\nuv run python poc.py --headless # try headless (closer to CI)\nuv run python poc.py --dump     # also write the raw first API page to poc-sample.json\n```\n\nSuccess = the script prints a non-zero `count` and real question records (not\nchallenge HTML), and reports where `taken_by` / `operating_system` /\n`thunderbird_version` live in the API response.\n\n## Scraping questions and answers\n\n```sh\n# Questions for a UTC date window (single day = same date twice).\nuv run python scrape_questions.py 2026 6 10 2026 6 10 --headless\n\n# Answers for those questions (defaults to the matching answers-... filename).\nuv run python scrape_answers.py \\\n    --questions 2026/questions-thunderbird-desktop-2026-06-10.csv --headless\n\n# Thunderbird for Android: same tools, --product thunderbird-android.\nuv run python scrape_questions.py 2026 6 10 2026 6 10 \\\n    --product thunderbird-android --headless\n```\n\nOutput is written to `\u003cyear\u003e/\u003cquestions|answers\u003e-\u003cproduct\u003e-\u003cdates\u003e.csv`, e.g.\n`2026/questions-thunderbird-desktop-2026-06-10.csv`. CSVs are sorted by ascending\n`id`. Both scrapers add a polite delay between API calls — a fixed `--sleep 2`\nseconds by default, or `--random-delay` to vary it between `--min-delay` and\n`--max-delay` (2–10s).\n\nQuestions keep the original columns/flattening plus `operating_system`,\n`thunderbird_version`, and `taken_by`. Answers use the original columns:\n`id, question_id, created, updated, content, creator, is_spam, num_helpful,\nnum_unhelpful`.\n\nThe `2026/` directory holds committed fixtures from a verification run against\n2026-06-10 (a pre-challenge day), reconciled against the public website.\n\n## Schema drift check\n\n`check_schema.py` samples the live API and compares its JSON fields against the\ncommitted baseline `schema/expected-fields.json`:\n\n```sh\nuv run python check_schema.py --headless                  # exit 1 on drift\nuv run python check_schema.py --headless --update-baseline  # manual bump\n```\n\nA daily workflow (`.github/workflows/schema-check.yml`) runs the check and opens\n(or comments on) a `schema-change` issue when fields are added or removed. The\nbaseline is **only** updated manually: when the API legitimately changes, review\nthe drift, re-run with `--update-baseline`, and commit — and if a field was\n*removed*, update the scrapers so the affected CSV columns don't silently blank.\n\n* We require all those who participate in this repo to agree and adhere to the [Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderbird%2Faaq-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunderbird%2Faaq-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunderbird%2Faaq-scraper/lists"}