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

pjblog-plugin-reprint-article

v1.2.3

Published

PJBlog插件之转载分享插件。提供系统hook级别的转载数据以及转载流程,方便用户交互。

Downloads

18

Readme

概述

自动转载插件。使用条件限制:

  1. 双方博客均为PJBlog
  2. 双方博客均安装了 pjblog-plugin-reprint-article 插件

功能流程:

  1. 从对方博客文章的详情页获取 转载 Token
  2. 在已方的模块 - 高级 - 我创建的转载中填入输入框创建转载码
  3. 将此转载码填入到对象博客文章详情页的转载输入框

此时您的申请对方已收到,根据文章转载权限的设定:

  • 如果为公开转载,那么在您输入转载码后,文章已自动同步到您的博客
  • 如果为申请转载,那么需要对方博客管理员在模块 - 高级 - 我收到的转载申请中同意或者拒绝

此插件能提高博客用户的粘性,非常值得大家推荐使用。此插件目的为增加博客间的交互与交流。

主题处理

插件在文章详情页提供了额外的字段

interface IArticle {
  ...,
  prints: {
    total: number, // 此文章总转载数
    token: string, // 次文章被转载所需要用到的转载信息base64码
    level: number, // 此文章的转载等级 0: 申请转载 1: 公开转载 -1 禁止转载
  },
}

主题开发者可以根据额外的字段来设计。

响应申请处理

当用户在自己的平台上生成转载码后,博主需要进行如下处理:

// e4298148a620fb3ea86aae6043423096 为文章的code编码
request.put('http://127.0.0.1:8866/-/plugin/pjblog-plugin-reprint-article/provider/e4298148a620fb3ea86aae6043423096', {
    "base64": "这里输入转载码"
})

请求将返回如下的结构

{
  "status": 200,
  "data": {
    "level": 0 // 对象本文的转载等级
  }
}

热门转载文章

插件提供用于侧边栏的热门转载功能

interface IData {
  title: string,
  code: string,
  count: number,
}

request.get('http://127.0.0.1:8866/-/plugin/pjblog-plugin-reprint-article/hot');

// 响应的数据结构如下
{
  "status": 200,
  "data": [
    {
      "title": "欢迎使用PJBlog",
      "code": "e4298148a620fb3ea86aae6043423096",
      "count": "1"
    }
  ] as IData[]
}

等级

两种等级的区别为

  1. 公开转载 当用户输入转载码后系统自动同意,能够非常快速将文章同步到用户的网站,无需博主去后台同意。
  2. 申请转载 用户提交转载码后不会立即同步文章,需要博主去后台同意。当同意后文章自动同步到用户博客。

当然,没有在插件后台管理的文章均被认为禁止转载