# Changelog of Weibo Keyword Search Scraper (`opspilot.cc/weibo-keyword-search-scraper`) Actor

- **URL**: https://apify.com/opspilot.cc/weibo-keyword-search-scraper/changelog.md
- **Full Actor documentation**: https://apify.com/opspilot.cc/weibo-keyword-search-scraper.md

## Changelog

### \[0.2] - 2026-10-12

- The run can no longer be killed by the key-value store. Under
  `LIMITED_PERMISSIONS` — how Apify's automated QA and every API-triggered run
  starts an Actor — opening the store is refused with HTTP 403
  (`KeyValueStoreCollectionClient.getOrCreate`, path `/v2/key-value-stores`).
  That call sat in a `||` fallback chain and was never inside a `try/catch` of
  ours, so the throw ended the run with exit code 91 and a reported FAILED run
  with zero items. Every store open now goes through a wrapper that returns a
  no-op store instead of throwing, so the free-run counter and the run SUMMARY
  degrade and the actual work proceeds.
- The gate store's name-to-id lookup no longer depends on the store still being
  on the first page. There is no GET-by-name endpoint, so the lookup pages
  through `/v2/key-value-stores`; it used a fixed `limit=50`, which silently
  stopped containing gate stores once the account passed 50 of them — and the
  account creates a new default store on every run, so that list grows on its
  own. The lookup now pages (100 per page, up to 20 pages).

## CHANGELOG — Weibo Keyword Search Scraper

### 0.1.5 - 2026-08-21

- **Rebrand (no API change)**: rename internal client to `UpstreamClient`; env vars `TIKHUB_API_KEY` / `TIKHUB_BASE_URL` → `UPSTREAM_API_KEY` / `UPSTREAM_BASE_URL`; file `src/tikhub_client.js` → `src/upstream_client.js`. Per our internal SOP §100 (no upstream name in user-facing surfaces), existing 0.1.4 runs keep working until the next push.
- **Fix (bonus)**: `test/integration.js` was the hot-search template (called `fetchTrendTop` + `intervalSeconds`); replaced with a keyword-specific test that calls `fetchSearch` and asserts `keyword` + `searchType` on the first item. 4/4 unit + 1/1 integration tests PASS.

### 0.1.4 - 2026-08-20

- **Fix**: `keyValueStore.setValue('SUMMARY', {...})` requires `JSON.stringify` + `contentType: 'application/json'`, otherwise the SDK rejects (value must be String/Buffer/Stream when `options.contentType` is specified).
- **Fix**: free-run counter switched to `JSON.stringify(current + 1)` write / parse-on-read (the previous `text/plain` + string round-trip broke because `getValue` already auto-deserialises JSON).
- **Verified**: `apify call` SUCCEEDED, ~10 search items pushed to default dataset.

### 0.1.3 - 2026-08-20

- Re-push with README fix (real Actor ID `rXAua7eiA6jxRogdF`).
- Followed §99 (no self Actor ID in mutual-reference table).
- 5 sister Actors left as `TBD` (next in MVP-2a).

### 0.1.2 - 2026-08-20

- Initial push SUCCEEDED with `apify push` build 0.1.1 → 0.1.2.
- Actor ID `rXAua7eiA6jxRogdF`.
- Free tier 5 runs/day limit enforced via KV counter.
- 7 `searchType` values (1=综合, 61=实时, 3=用户, 60=热门, 64=视频, 63=图片, 21=精华) all wired per §40.
- 4 `timeScope` values (不限/一小时内/一天内/一周内/一个月内) wired.
- `PAGE_HARD_CAP = 1` because page=2+ triggers upstream login wall (§39 maxItems must match upstream).
- §98 list-of-dict path handling in `extractMblogs()` (handles both `cards[].mblog` and `cards[].card_group[].mblog`).
- 4/4 unit tests PASS, 1/1 integration tests PASS.
