| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/usr/bin/env python3
- # DSH ecosystem snapshot: GitHub stars + npm downloads + latest version
- # usage: python3 fetch-ecosystem.py [outfile.md]
- import json, sys, urllib.request
- from datetime import datetime
- REPOS = [
- "deepseek-ai/deepseek-harness",
- "anywhere-labs/deepseek-harness-desktop",
- "awesome-dsh-plugin/awesome-dsh-plugin",
- "yjh051108/dsh-routing-suite",
- "zhu1090093659/dsh-web-ui",
- "ccch1mneyyy/dsh-TUI",
- "dataelement/dsh-desktop",
- "dsh-market/dsh-market",
- "Small-tailqwq/dsh-deep-whale",
- "fufankeji/deepseek-harness-studio",
- "lencx/Minke",
- "TermonyHQ/Termony",
- "hust-open-atom-club/oh-dsh",
- "shenjackyuanjie/dsh-ohos-patch",
- ]
- def get(url):
- req = urllib.request.Request(url, headers={"User-Agent": "dsh-harmony-kb"})
- with urllib.request.urlopen(req, timeout=15) as resp:
- return json.loads(resp.read().decode())
- lines = ["# DSH ecosystem snapshot " + datetime.now().strftime("%Y-%m-%d %H:%M"), ""]
- lines += ["## GitHub repos", "", "| repo | stars | forks | last push |", "|---|---|---|---|"]
- for r in REPOS:
- try:
- d = get("https://api.github.com/repos/" + r)
- lines.append("| {} | {} | {} | {} |".format(d.get("full_name"), d.get("stargazers_count"), d.get("forks_count"), str(d.get("pushed_at", ""))[:10]))
- except Exception as e:
- lines.append("| {} | ERR | - | - |".format(r))
- lines += ["", "## npm (@deepseek-ai/dsh)", ""]
- for label, url in [("weekly", "https://api.npmjs.org/downloads/point/last-week/@deepseek-ai/dsh"), ("monthly", "https://api.npmjs.org/downloads/point/last-month/@deepseek-ai/dsh")]:
- try:
- lines.append("- " + label + " downloads: " + str(get(url).get("downloads")))
- except Exception:
- lines.append("- " + label + " downloads: ERR")
- try:
- lines.append("- latest version: " + str(get("https://registry.npmjs.org/@deepseek-ai/dsh").get("dist-tags", {}).get("latest")))
- except Exception:
- lines.append("- latest version: ERR")
- lines += ["", "watch: anywhere-labs cross-platform moves, dsh-web-ui mobile remote, Termony+ohos CLI combo.", ""]
- out = chr(10).join(lines)
- print(out)
- if len(sys.argv) > 1:
- open(sys.argv[1], "w").write(out)
- print("saved to " + sys.argv[1], file=sys.stderr)
|