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

hexo-douban-list

v1.2.5

Published

A plugin for hexo to generate douban reviews from douban.com.

Downloads

36

Readme

hexo-douban-list

GitHub license

基于HEXO豆瓣插件 hexo-douban 的二次开发插,强烈建议先试用原插件,如果您觉得以下特性更能满足您的需要,那么再使用本插件。

主要特性:

  • 原项目固有特性;
  • 重构模板页面,支持移动适配;
  • 补全列表影评内容,支持短评和长影评(核心);
  • 支持生成指定长度的列表(对于观影数量较多的用户);
  • 样式inline化,允许直接嵌入同源其他页面;
    <div id="dbcontent"></div>
    <script>$('#dbcontent').load('./movies/index.html .hexo-douban-item:nth-child(1)');</script>

注意:本插件构建的页面完全不保证兼容IE等上古浏览器,推广使用现代浏览器,人人有责。

第一步:安装

# 如果您使用过原插件请先卸载之
$ npm uninstall --save hexo-douban
$ npm install --save hexo-douban-list

第二步:配置

将下面的配置写入站点的配置文件 _config.yml 里(不是主题的配置文件).

douban:
  user: 205XXX876
  builtin: true
  movie:
    title: '已看电影(豆瓣短评+长影评)'
    quote: <p>光影之中品百味人生。 <a target="_blank" href="https://github.com/TianZonglin/hexo-douban-list">// 本页使用 hexo-douban-list 插件构建</a></p>
    length: 2
    textlen: 120
    valine_id: WbLE8XXXoHsz # 当渲染页的valine加载不出来时使用(默认置空)
    valine_key: ycqjXXXRkrdO
  timeout: 100000

注意:以上内容中务必确定 USER ID 的正确性!

  • user: 你的豆瓣ID.打开豆瓣,登入账户,然后在右上角点击 "个人主页" ,这时候地址栏的URL大概是这样:"https://www.douban.com/people/xxxxxx/" ,其中的"xxxxxx"就是你的个人ID了。
  • builtin: 是否将生成页面的功能嵌入hexo shexo g中,默认嵌入(TRUE)即npm安装后无需任何操作按原命令部署博客即可生效。
  • title: 该页面的标题。
  • quote: 写在页面开头的一段话,支持html语法。
  • length: 默认值为2,非页数,可以自由尝试(建议取值:2-4)。
  • timeout: 爬取数据的超时时间,默认是 10000ms ,如果在使用时发现报了超时的错(ETIMEOUT)可以把这个数据设置的大一点。

对于 valine_idvaline_key,主要针对的是Volantis主题(以及其他默认渲染评论区域的主题),如果您在测试时页面没有评论区域,则可以忽略这两项,如果出现以下显示则需要填写此两项。(这两项是什么?请移步Valine官方介绍

使用

注意,通常大家都喜欢用hexo d来作为hexo deploy命令的简化,但是当安装了hexo douban之后,就不能用hexo d了,因为hexo doubanhexo deploy的前缀都是hexo d

升级

使用 npm install hexo-douban-list --update --save 直接更新。

测试

执行 hexo clean && hexo generate && hexo server,之后访问 localhost:4000/movies 即可访问生成的影评页面。

删除(可补回来)的内容

相比较于原项目,取消或删除了以下内容:

  • 去掉了书籍和音乐,单纯针对电影
  • 去掉了影评页跳转的菜单按钮
  • 去掉了以上项目涉及的配置开关

异常

如果构建页面为空或404,且日志输出为 INFO 0 movies have been loaded in xx ms,这时怀疑您的IP由于多次请求豆瓣的页面而被豆瓣封禁了,一般第二天会解禁,使用代理或更改IP即可解决。

示例

https://www.cz5h.com/movies