npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chch

v2.8.0

Published

5ch 用スクリプト集だよ

Downloads

49

Readme

npm version github actions License: MIT

chch

5ch 用スクリプト集だよ

Install

  • module
$ npm install chch
  • CLI
$ npm install chch -g
# or
$ npx chch

API

getThread(url: string)

Returns an Thread

Thread object with:

  • title (string)
  • url (string)
  • postCount (number) - count of posts
  • size (string) - thread page total size 10KB
  • posts (Post[])
    • number (number) - res number
    • name (string) -
    • userId (string) - ID
    • timestamp (number) - Unix Epoch
    • comma (number) - comma of timestamp
    • message (string) -

getThreads(url: string)

Returns Thread[] (without posts field)

postMessage(url: string, message: string)

post message

CLI

$ npm install chch

dump

スレッド情報とレス一覧の取得

$ chch dump https://hebi.5ch.net/test/read.cgi/news4vip/1562153470/
{
  "title": "プログラム「a=a+b」←こいつwwwwww",
  "url": "https://hebi.5ch.net/test/read.cgi/news4vip/1562479977/",
  "postCount": null,
  "posts": [
    {
      "number": "1",
      "name": "以下、5ちゃんねるからVIPがお送りします",
      "userId": "",
      "timestamp": 1562479977678,
      "comma": 678,
      "message": "算数もできないのかよ……"
    },
    {
      "number": "2",
...
$ chch dump https://hebi.5ch.net/test/read.cgi/news4vip/1562153470/ |jq '.posts[].comma'
678
133
487
517
787
...

dump-threads

スレッド一覧の dump

$ chch dump-threads
# スレタイ検索
$ chch dump-threads |jq -r '.threads[] | "\(.title)\t\(.url)"' |peco

watch

スレの監視と新着ポストの標準出力

$ chch watch [url] [command]
# 受取時に音を出す
$ chch watch https://hebi.5ch.net/test/read.cgi/news4vip/1562153470/ -c "say got"

hosyu

$ chch hosyu http://hebi.5ch.net/test/read.cgi/news4vip/1556625403
保守スタート
新・保守時間目安表 (休日用)
00:00-02:00 10分以内
02:00-04:00 20分以内
04:00-09:00 40分以内
09:00-16:00 15分以内
16:00-19:00 10分以内
19:00-00:00 5分以内

新・保守時間の目安 (平日用)
00:00-02:00 15分以内
02:00-04:00 25分以内
04:00-09:00 45分以内
09:00-16:00 25分以内
16:00-19:00 15分以内
19:00-00:00 5分以内

posted: Sat May 11 2019 15:21:55 GMT+0900 (GMT+09:00) next: 15min
posted: Sat May 11 2019 15:06:53 GMT+0900 (GMT+09:00) next: 15min

trip-dig [deprecated]

トリップの採掘

$ chch trip-dig [prefix] [regex] [start | "a"] [interval | 100]
  • regex: ログする文字列。正規表現。
  • start: suffix の初期値。途中で停止して再開するときなどに指定する。使える文字列は a-zA-Z。(default: "a")
  • interval: sleep する間隔。大きいほど CPU 使う。(default: 100)
# 正規表現
$ chch trip-dig p____ "[0-9]+vip(vi)+$"

# ゆっくり
$ chch trip-dig p____ "^vip" aaaaaaa 10

# ガンガン採掘
$ chch trip-dig p____ "^vip" aaaaaaa 10000