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-steam-games

v1.3.3

Published

Hexo Steam games page

Downloads

80

Readme

hexo-steam-games

介绍

为Hexo添加Steam游戏库页面.

Demo

安装

$ npm install hexo-steam-games --save

配置

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

steam:
  enable: true
  steamId: '*****' #steam 64位Id
  apiKey: '*****' #steam api key
  steamInfos: # 多账号配置
    - id: '*****' #steam 64位Id
      path: # 为每个帐号游戏库单独配置页面路径,默认`steamgames/{steamId}/index.html`
      ... # 兼容以下配置项
    - id: '*****'
      ...
  freeGames: true
  path:
  title: Steam游戏库
  quote: '+1+1+1+1+1'
  tab: recent
  length: 1000
  imgUrl: '*****'
  proxy:
    host:
    port:
  extra_options:
    key: value
  • enable: 是否启用
  • apiKey: Steam 网页 API Key(新版需要API Key才能获取到游戏信息,点此注册 API Key),或者手动获取游戏库数据
  • steamId: steam 64位Id(需要放在引号里面,不然会有BUG), 需要将steam库设置为公开!
  • steamInfos: 多账号配置
  • path: 游戏页面路径,默认steamgames/index.html
  • title: 该页面的标题
  • quote: 写在页面开头的一段话,支持html语法
  • tab: allrecent, all: 所有游戏, recent: 最近游玩的游戏
  • length: 要显示游戏的数量,游戏太多的话可以限制一下
  • imgUrl: 图片链接,在quote下面放一张图片,图片链接到Steam个人资料,可留空
  • proxy: 如果无法访问steam社区的话请使用代理
    • host: 代理ip或域名
    • port: 代理端口
  • extra_options: 此配置会扩展到Hexo的page变量中

使用

  1. hexo generatehexo deploy之前使用hexo steam -u命令更新steam游戏库数据!
  2. 删除游戏库数据指令:hexo steam -d

手动获取游戏库数据

如果hexo steam -u命令一直获取游戏库数据失败,可以用一下方法手动获取游戏库数据:

  1. 浏览器打开https://steamcommunity.com/profiles/{steamId}/games?tab={tab}, {steamId}{tab}分别替换为上面配置中提到的steamIdtab

  2. 网页加载完成后,打开浏览器控制台(按F12),输入以下代码并回车:

    const data = document.querySelector('#gameslist_config').getAttribute('data-profile-gameslist');
    const games = JSON.parse(data.replace(/\n/g, '')).rgGames;
    document.write(JSON.stringify(games).replace(/\n/g, ''));
  3. 将生成的内容复制到博客根目录/node_modules/hexo-steam-games/data/games.json文件内,如果没有对应的文件或目录,请自行创建

示例

示例图片 示例图片

Lisense

Apache Licence 2.0