区块城市

v1.2.0

BlockCity区块城市数据获取Skill,支持从排名页获取城市排名、居民人数、开启区块数,从城市详情页获取基金余额、剩余人气值等信息

0· 133·0 current·0 all-time
bybittao@hgta23

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for hgta23/blockcity.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "区块城市" (hgta23/blockcity) from ClawHub.
Skill page: https://clawhub.ai/hgta23/blockcity
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install blockcity

ClawHub CLI

Package manager switcher

npx clawhub@latest install blockcity
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk97acc99387h73ngf5szqe2h1d849we2
133downloads
0stars
5versions
Updated 3w ago
v1.2.0
MIT-0

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页面

Comments

Loading comments...