Skip to content

Add interaction counts and update time to smzdm search results #1961

Description

@dengshu2

Summary

Please enhance opencli smzdm search to include the structured interaction metrics and update time that are already visible on the SMZDM search result page.

Current output columns are:

rank, title, price, mall, comments, url

Suggested output columns:

rank, title, price, mall, updated_at, zhi_count, buzhi_count, favorite_count, comments, url

comments already exists; the request is to add the surrounding metrics and time so agents/users can filter search results without opening each detail page.

Why this is useful

For deal triage, these fields are high-signal:

  • updated_at: tells whether the deal is fresh or stale.
  • zhi_count: visible "值" count.
  • buzhi_count: visible "不值" count.
  • favorite_count: visible star/favorite count.
  • comments: already present, useful for filtering out zero-discussion results.

Example use case: when searching thinkbook14+, results with comments = 0 can be skipped, while older results with high favorites/comments may still be worth checking.

DOM evidence

The current adapter already scrapes li.feed-row-wide from:

https://search.smzdm.com/?c=home&s=<keyword>&v=b

The requested fields are present in the same list item DOM and do not require opening each detail page.

Observed structure:

<div class="z-feed-foot-l">
  <span class="feed-btn-group price-btn-hover">
    <span class="J_zhi_like_fav price-btn-up" data-type="zhi" data-zhi-type="1">
      <span class="unvoted-wrap"><span>11</span></span>
    </span>
    <span class="J_zhi_like_fav price-btn-down" data-type="zhi" data-zhi-type="-1">
      <span class="unvoted-wrap"><span>3</span></span>
    </span>
  </span>
  <span class="J_zhi_like_fav z-group-data feed-btn-fav">
    <span>40</span>
  </span>
  <a class="z-group-data feed-btn-comment" title="评论数 24">24</a>
</div>

<span class="feed-block-extras">
  05-23 00:28
  <span>天猫精选</span>
</span>

This corresponds to:

{
  "updated_at": "05-23 00:28",
  "zhi_count": 11,
  "buzhi_count": 3,
  "favorite_count": 40,
  "comments": 24,
  "mall": "天猫精选"
}

Suggested implementation

In clis/smzdm/search.js, inside the existing page.evaluate block:

  • Extract up count from .price-btn-up .unvoted-wrap span.
  • Extract down count from .price-btn-down .unvoted-wrap span.
  • Extract favorite count from .feed-btn-fav span.
  • Extract update time from .z-feed-foot-r .feed-block-extras by removing the nested mall span text or reading child text nodes before the nested span.
  • Keep the existing comments extraction.

This should be a small extension of the current DOM scraping approach rather than a new detail-page request.

Example desired row

{
  "rank": 6,
  "title": "ThinkPad 联想ThinkBook14+ 锐龙R7 H 255 14.5英寸轻薄商务办公学生游戏笔记本",
  "price": "4015.44元(需用券)",
  "mall": "天猫精选",
  "updated_at": "05-23 00:28",
  "zhi_count": 11,
  "buzhi_count": 3,
  "favorite_count": 40,
  "comments": 24,
  "url": "https://www.smzdm.com/p/174854494/"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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