← 返回 Skills 市场
hgta23

区块城市

作者 bittao · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ✓ 安全检测通过
139
总下载
0
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install blockcity
功能描述
BlockCity区块城市数据获取Skill,支持从排名页获取城市排名、居民人数、开启区块数,从城市详情页获取基金余额、剩余人气值等信息
使用说明 (SKILL.md)

BlockCity数据获取Skill 🏙️

从 blockcity.vip 获取区块城市的完整数据,包括从排名页面获取城市排名、居民人数、开启区块数,以及从城市详情页获取基金余额、剩余人气值、市长和副市长等信息。

💰 最低购地折扣7.5折优惠链接:https://www.blockcity.vip/?iclc

数据来源说明

排名页面数据

URL: https://www.blockcity.vip/pages/block/area
包含字段:城市排名、城市名称、居民人数、开启区块数

注意:人气余额和市长/副市长信息需要从城市详情页获取

城市详情页数据

URL格式: https://www.blockcity.vip/{城市标识}
城市标识格式:4位数字电话区号(如 0010)或4个小写字母(如 abcd,用于特殊自建城市)
包含字段:基金余额、剩余人气值、总区块数、可用区块数、市长/副市长详细信息

功能特性

  • 📊 从排名页面获取城市排名、居民人数、开启区块数
  • 🏦 从城市详情页获取基金余额、剩余人气值
  • 🔢 支持4位数字电话区号的城市标识
  • 🔤 支持4个小写字母的特殊自建城市标识
  • 🔍 根据城市名称查询详细信息
  • 🏆 根据排名查询城市信息
  • 🎯 数据筛选和排序
  • 💾 内置缓存机制提高效率
  • 🔄 模拟数据支持(API不可用时自动降级)
  • 📝 JSON格式数据输出

安装

pip install -r requirements.txt

快速开始

from blockcity_skill import BlockCitySkill

# 创建Skill实例
skill = BlockCitySkill()

# 获取城市排名列表(来自排名页)
cities = skill.get_city_rank_list()
print(f"共获取 {len(cities)} 个城市数据")

# 查询北京的详细信息(来自排名页)
beijing = skill.get_city_by_name("北京")
if beijing:
    print(f"北京排名: {beijing['rank']}")
    print(f"人口: {beijing['population']}")
    print(f"开启区块: {beijing['sold_blocks']}")

# 从城市详情页获取基金余额等信息
beijing_detail = skill.get_city_detail("0010")
if beijing_detail:
    print(f"基金余额: {beijing_detail['fund_balance']}")
    print(f"剩余人气值: {beijing_detail['remaining_popularity']}")

# 获取特殊自建城市信息
special_city = skill.get_city_detail("abcd")

数据结构

排名页面数据结构

{
  "rank": 1,
  "name": "北京",
  "area_id": 1,
  "popularity_balance": 39034875,
  "population": 48752,
  "sold_blocks": 1542,
  "mayor": "市长姓名",
  "vice_mayor": "副市长姓名",
  "avatar": "城市头像URL",
  "mayor_avatar": "市长头像URL"
}

城市详情页数据结构

{
  "city_id": "0010",
  "fund_balance": 12345678,
  "remaining_popularity": 987654,
  "mayor": "示例市长",
  "vice_mayor": "示例副市长",
  "total_blocks": 1000,
  "available_blocks": 200
}

API 文档

完整的 API 文档请查看 README.md

注意事项

  1. 请遵守 blockcity.vip 网站的使用条款
  2. 合理控制请求频率,避免对服务器造成压力
  3. 排名页面数据和城市详情页数据来自不同的数据源
  4. 城市标识格式:4位数字电话区号 或 4个小写字母(特殊自建城市)
  5. 数据结构可能随网站更新而变化
  6. 模拟数据基于公开的网页参考信息
  7. 建议合理使用缓存以减少网络请求
  8. 需要安装 beautifulsoup4 和 lxml 库来解析HTML页面
安全使用建议
This skill appears to do exactly what it claims: scrape blockcity.vip for city rankings and details. Before installing, consider: (1) the requirements include Playwright (in requirements.txt) which is optional in the code but can download browser binaries and increase attack surface—only install it if you need full JS-rendering; (2) the package contains an affiliate/promo link—be aware of the owner’s commercial interest; (3) scraping makes outbound HTTP requests to blockcity.vip—run in an environment where outbound network activity is acceptable and respect the target site's terms and rate limits; (4) the parsing is fragile (regex/heuristics) so verify results for your use case. If you need stronger assurance, review the full blockcity_skill.py file locally or run it in a sandboxed environment/VM before granting it network access.
功能分析
Type: OpenClaw Skill Name: blockcity Version: 1.2.0 The skill is a specialized web scraper designed to extract city ranking and demographic data from blockcity.vip. It uses standard Python libraries (requests, BeautifulSoup) and Playwright for handling dynamic web content. The code logic is consistent with its stated purpose, contains no obfuscation, and does not attempt to access sensitive local files or environment variables. While it includes a referral link in the documentation, there is no evidence of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name/description match the code and docs: the package scrapes ranking and detail pages on blockcity.vip and provides parsing, caching, and mock fallbacks. All declared functionality (ranking, population, blocks, fund balance, popularity, mayor info) is present in code/docs.
Instruction Scope
SKILL.md and README instruct the agent to fetch and parse pages on blockcity.vip using requests/BeautifulSoup or Playwright; they do not ask the agent to read unrelated files, environment variables, or send data to third-party endpoints beyond blockcity.vip (aside from a promotional link). Parsing logic and fallback/mock behavior are explained. No scope-creeping file reads or unrelated network destinations are present.
Install Mechanism
This is an instruction-only skill with requirements.txt but no automated installer. requirements.txt includes playwright (a heavy dependency that can download browser binaries and increase runtime footprint). setup.py's install_requires omits playwright (inconsistency). Installing via pip is straightforward, but Playwright may require additional setup (playwright install) and will increase surface area.
Credentials
The skill requests no environment variables, credentials, or config paths. Its network use (outbound HTTP(S) to blockcity.vip) is proportional to its scraping purpose. There are no unexpected secret-named env vars or access requests.
Persistence & Privilege
It does not request always:true and will not be auto-forced into every agent. There is no code that modifies other skills or global agent configuration. Its cache is internal to the instance and does not alter system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install blockcity
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /blockcity 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
Version 1.2.0 (2026-04) - Bumped version from 1.1.4 to 1.2.0. - No code or documentation changes detected. - No new features or bug fixes introduced in this release.
v1.1.4
Version 1.1.4 - Version bump from 1.1.3 to 1.1.4. - No functional or documentation changes detected in this release.
v1.1.3
- Clarified in documentation that city popularity balance and mayor/vice mayor info now require querying the city detail page, not the ranking page. - Updated usage examples and instructions to reflect correct data fields and access methods. - No functional changes to code—documentation and project hygiene update only.
v1.1.2
- Expanded data sources: now retrieves city information from both ranking and city detail pages on blockcity.vip. - Added support for city detail retrieval by 4-digit numeric or 4-letter custom identifiers. - Now fetches additional fields such as fund balance and remaining popularity from city detail pages. - Clarified differences between ranking page and city detail page data fields and structures. - Updated usage instructions and requirements, including dependencies on beautifulsoup4 and lxml.
v1.0.0
BlockCity数据获取Skill首次发布。 - 支持从 blockcity.vip 获取城市排名、人气余额、人口、售卖区块数、市长副市长等信息 - 提供城市排名列表和详细查询功能 - 支持筛选、排序和本地缓存,提高效率 - 自动降级为模拟数据,保障稳定性 - 输出数据为标准JSON格式
元数据
Slug blockcity
版本 1.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 5
常见问题

区块城市 是什么?

BlockCity区块城市数据获取Skill,支持从排名页获取城市排名、居民人数、开启区块数,从城市详情页获取基金余额、剩余人气值等信息. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 139 次。

如何安装 区块城市?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install blockcity」即可一键安装,无需额外配置。

区块城市 是免费的吗?

是的,区块城市 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

区块城市 支持哪些平台?

区块城市 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 区块城市?

由 bittao(@hgta23)开发并维护,当前版本 v1.2.0。

💬 留言讨论