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

douban-status-tracker

v1.0.0

Published

<p align="center"> <img width="400" src="https://user-images.githubusercontent.com/12277082/75358669-3dc4f480-58ee-11ea-8359-1dff65a7ff1d.png" /> <h2 align="center">Douban Box</h2> <p align="center">更新豆瓣用户的书影音数据到 Gist !</p> </p>

Downloads

7

Readme


📌✨ 更多像这样的 Pinned Gist 项目请访问:https://github.com/matchai/awesome-pinned-gists

安装

$ npm i -g douban-status-tracker

基本原理

提供四个环境变量: | 变量 | 含义 | |---|---| | GIST_ID | Gist ID | | GH_TOKEN | GitHub Token | | DOUBAN_ID | 豆瓣用户 ID | | DOUBAN_COOKIE | 豆瓣登录态 Cookie | | LANG | 偏好语言 |

执行 CLI 时会读取环境变量,抓取指定用户的主页,更新对应的 Gist,若无报错则说明更新成功。

$ douban-status-tracker

另外可以通过 GitHub Actions 免费实现定时更新的功能。

使用

1. 创建 Gist

Gist 中新建名为 douban.md 的文件,并从 URL 中得到 Gist ID。

2. 创建 GitHub Token

访问 Personal Access Tokens 创建更新 Gist 专用的 Token,需要勾选 gist - Create gists 权限,记住新生成的 Token。

3. 获取豆瓣 ID 和 Cookie

豆瓣 ID 是个人主页中 people 后紧接的那串数字或者自定义字符,例如我的主页链接 https://www.douban.com/people/daraw/ 中是 daraw,在登录态下查看 Cookie,其中 dbcl2 是关键,复制这个 key 对应的值,构造出 dbcl2="xxxxxxx" 即可当做 Cookie,当然把整个 Cookie 都复制过去也是可以的。

4. 通过 GitHub Actions 自动更新 Gist

  • 创建一个 Repo 并启用 GitHub Actions,可以参考本项目的 .github/workflows/main.yml 文件。

  • 修改 GIST_IDDOUBAN_ID 为刚刚所得到的 Gist ID 和豆瓣 ID。

  • 在项目的 Settings -> Secrets 中新建上述的环境变量。

之后每次 push 和每日 00:00 UTC+0 时会触发更新 Gist,如果需要修改触发时机可以调整刚刚的 GitHub Actions 配置文件。

License

MIT License