An open API service indexing awesome lists of open source software.

https://github.com/gera2ld/duoshuo-ua

多说评论插件,显示留言用户使用的操作系统和浏览器。
https://github.com/gera2ld/duoshuo-ua

Last synced: 13 days ago
JSON representation

多说评论插件,显示留言用户使用的操作系统和浏览器。

Awesome Lists containing this project

README

          

多说User-Agent插件
===

![Bower](https://img.shields.io/bower/v/duoshuo-ua.svg)
![npm](https://img.shields.io/npm/v/duoshuo-ua.svg)

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

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

安装
---
* Bower

``` sh
$ bower install duoshuo-ua
```

* NPM

``` sh
$ npm install duoshuo-ua
```

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

* getUAString: *function* (local)
是对每条留言显示内容进行处理的函数,默认将加上操作系统和浏览器的显示。
参数local是一个object,包括以下属性:
* agent: *string*
本条回复的UserAgent字符串。
* webmaster: *int*
如果本条回复是站长回复,则为本回复中站长的id,否则为0。

下面是一个简单的例子:
``` HTML

var duoshuoQuery={short_name:'test',myIds:[1234567]};

```

更高级的例子见examples。

更多介绍:

案例
---

1. 我的网站:
1. 在线工具: