Skip to content

fix(recruiter): make recommend hit the real 推荐牛人 endpoint with working pagination#28

Open
chengyixu wants to merge 1 commit into
jackwener:mainfrom
chengyixu:fix/recommend-pagination-misleading
Open

fix(recruiter): make recommend hit the real 推荐牛人 endpoint with working pagination#28
chengyixu wants to merge 1 commit into
jackwener:mainfrom
chengyixu:fix/recommend-pagination-misleading

Conversation

@chengyixu

Copy link
Copy Markdown
Contributor

Summary

boss recruiter recommend was calling /wapi/zprelation/friend/greetRecSortList ("greet rec sort list" — a re-sort of already-greeted candidates), so:

  • Only ~10 candidates ever returned, regardless of --job
  • -p N returned the same list reshuffled (server ignores page)
  • Real candidate-discovery feed was unreachable from the CLI

Root cause

The BOSS recruiter web "推荐牛人" page uses infinite scroll. Capturing XHRs on scroll showed the real endpoint:

GET /wapi/zpjob/rec/geek/list?jobId=<encryptJobId>&page=N&age=16,-1&school=0&...&cardType=0
Referer: https://www.zhipin.com/web/frame/recommend/

It returns 15 candidates per page with a hasMore flag — true pagination.

Changes

  • Add BOSS_REC_GEEK_LIST_URL constant + Referer mapping for the recommend frame
  • Repoint get_boss_recommend_geeks at the real endpoint with the full filter param set the web page sends (all neutral / unset)
  • --job is now required (the endpoint is job-scoped, and the old "no-job" mode never worked usefully)
  • Render the richer geekCard payload: 姓名 / 年龄 / 经验 / 学历 / 城市 / 期望薪资 / 活跃 / encryptGeekId
  • Show a "下一页" hint when hasMore is true
  • Update README examples to require --job

Test plan

  • pip install -e . then boss recruiter recommend --job <encryptJobId> returns 15 candidates with hasMore: true
  • -p 2, -p 3, ... return fresh candidates (matches what the browser shows on scroll)
  • Missing --job produces a clear Click usage error
  • --json and --yaml envelopes unchanged
  • Reviewer to verify the param defaults (age=16,-1, school=0, etc.) are still what the BOSS web page sends (captured 2026-05-12)

🤖 Generated with Claude Code

…ing pagination

`recruiter recommend` previously called `/wapi/zprelation/friend/greetRecSortList`
("greet rec sort list"), which re-sorts the recruiter's already-greeted candidates
and ignores the `page` param. Result: users saw only ~10 candidates and `-p N`
returned the same list reshuffled.

The actual "推荐牛人" feed on the BOSS recruiter web page calls
`/wapi/zpjob/rec/geek/list` (XHR fired on infinite scroll), which:
  - returns 15 candidates per page
  - paginates via `page=N`
  - includes `hasMore` for the end-of-feed signal
  - requires a `Referer: /web/frame/recommend/` header

Changes:
  - Add `BOSS_REC_GEEK_LIST_URL` constant + Referer mapping
  - Repoint `get_boss_recommend_geeks` at the real endpoint with the full
    filter param set the page sends (age/school/activation/etc., zeroed)
  - `--job` is now required (the endpoint is job-scoped)
  - Render the richer `geekCard` payload: name / age / exp / degree / city /
    salary / activeTime / encryptGeekId, plus next-page hint when hasMore
  - Update README examples

Smoke-tested against an active recruiter account: page 1 returned 15
distinct candidates with `hasMore: true`; `-p 2`, `-p 3`, ... return
fresh batches as the browser does on scroll.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant