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

duoshuo-ua

v1.0.7

Published

Plugin of duoshuo to show operating systems and browsers for duoshuo comments.

Downloads

4

Readme

多说User-Agent插件

Bower npm

多说作为一个第三方评论功能感觉很不错的样子,而且可定制性很强。

多说在存储评论的时候其实是把User-Agent一起存储的,只是不显示出来,这个插件的作用就是把User-Agent显示出来,同时还可以标记站长的回复。

安装

  • Bower

    $ bower install duoshuo-ua
  • NPM

    $ npm install duoshuo-ua

文档

duoshuoQuery中可以定义myIdsgetUAString函数:

  • myIds: Array
    是站长自己的多说数字id,可以有多个,用于区分站长的回复,并可在getUAString中加上不同的标记,如不定义则不会对站长回复进行区分。

  • getUAString: function (local)
    是对每条留言显示内容进行处理的函数,默认将加上操作系统和浏览器的显示。
    参数local是一个object,包括以下属性:

    • agent: string
      本条回复的UserAgent字符串。
    • webmaster: int
      如果本条回复是站长回复,则为本回复中站长的id,否则为0。

下面是一个简单的例子:

<html>
<head>
<link rel="stylesheet" href="dist/duoshuo-ua.css">

<!-- 第1部分:在embed.js之前定义duoshuoQuery和加载duoshuo-ua
两者顺序可以交换-->
<script src="dist/duoshuo-ua.js"></script>
<script>var duoshuoQuery={short_name:'test',myIds:[1234567]};</script>

<!-- 第2部分:可写成异步加载,必须写在第1部分后面 -->
<script src="http://static.duoshuo.com/embed.js"></script>

<!-- 只需要按以上顺序加载,不一定要写在<head>中 -->

</head>
<body>

<div class="ds-thread" data-thread-key="example"></div>

</body>
</html>

更高级的例子见examples。

更多介绍:http://gerald.top/code/duoshuo-ua

案例

  1. 我的网站:http://gerald.top
  2. 在线工具:http://www.atool.org