All Projects → dongyuanxin → page-counter

dongyuanxin / page-counter

Licence: MIT License
基于Serverless开发的的极简网页计数器,支持基于Hexo、Jekyll、Octopress、ReactJS、VueJS等框架开发的博客、网站、中后台等任何应用。

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to page-counter

aut
The Archives Unleashed Toolkit is an open-source toolkit for analyzing web archives.
Stars: ✭ 111 (+282.76%)
Mutual labels:  analysis
MalScan
A Simple PE File Heuristics Scanners
Stars: ✭ 41 (+41.38%)
Mutual labels:  analysis
KInspector
KInspector is an application for analyzing health, performance and security of your Kentico solution.
Stars: ✭ 54 (+86.21%)
Mutual labels:  analysis
hawk
Collection of the tools for the efficient network analysis and modelling.
Stars: ✭ 15 (-48.28%)
Mutual labels:  analysis
OverWatchTeams
react+redux+redux-saga+axios
Stars: ✭ 23 (-20.69%)
Mutual labels:  leancloud
keen-sdk-net
A .NET SDK for the Keen IO API
Stars: ✭ 35 (+20.69%)
Mutual labels:  analysis
flask-todo-demo
Python port of LeanTodo.
Stars: ✭ 32 (+10.34%)
Mutual labels:  leancloud
bloc-pattern-example
Detailed example of the BLoC pattern in Flutter
Stars: ✭ 23 (-20.69%)
Mutual labels:  counter
RDPlot
Tool for plotting rd curves from output of video coding test model software
Stars: ✭ 22 (-24.14%)
Mutual labels:  analysis
xbpch
xarray interface for bpch files
Stars: ✭ 17 (-41.38%)
Mutual labels:  analysis
Fee-blog
免费搭建自己的博客,看心情更新
Stars: ✭ 19 (-34.48%)
Mutual labels:  leancloud
keen-analysis.js
A light JavaScript client for Keen
Stars: ✭ 40 (+37.93%)
Mutual labels:  analysis
snorkeling
Extracting biomedical relationships from literature with Snorkel 🏊
Stars: ✭ 56 (+93.1%)
Mutual labels:  analysis
uldaq
MCC Universal Library for Linux
Stars: ✭ 70 (+141.38%)
Mutual labels:  counter
mysql-xplain-xplain
🐭 Explain Explainer for MySQL Queries.
Stars: ✭ 51 (+75.86%)
Mutual labels:  analysis
static file analysis
Analysis of file (doc, pdf, exe, ...) in deep (emmbedded file(s)) with clamscan and yara rules
Stars: ✭ 34 (+17.24%)
Mutual labels:  analysis
stat-counters
The library, which provides statistics counters, e.g. Google analytics, Yandex metrica, etc
Stars: ✭ 16 (-44.83%)
Mutual labels:  counter
progress
Easy progress reporting for D
Stars: ✭ 20 (-31.03%)
Mutual labels:  counter
RNAseq titration results
Cross-platform normalization enables machine learning model training on microarray and RNA-seq data simultaneously
Stars: ✭ 22 (-24.14%)
Mutual labels:  analysis
ips-bph-framework
BLACKPHENIX is an open source malware analysis automation framework composed of services, scripts, plug-ins, and tools and is based on a Command-and-Control (C&C) architecture
Stars: ✭ 21 (-27.59%)
Mutual labels:  analysis

Page Counter

基于 Serverless 开发的的极简网页计数器,支持基于 HexoJekyllOctopressReactJSVueJS 等框架开发的博客、网站、中后台等任何应用

特性

  • 无后端快速部署
  • 源码精简,大小仅 5kb
  • 支持 npmCDN 引入
  • 数据安全、自持有、永久存储
  • 支持 LeancloudBomb 平台
  • 支持腾讯云云开发(敬请期待)

浏览器支持

Chrome Firefox Safari Opera Edge
Latest Latest Latest Latest Latest ×

快速使用

Leancloud 平台

用法一:CDN 引入

到Leancloud控制台查看应用相关信息,将以下代码插入 <head> 标签中:

<script>
  window.PAGE_COUNTER_CONFIG = {
    serverless: 'leancloud',
    leancloud: {
      history: 0, // 历史访客数量,可不填,默认是0
      table: '存放数据的表格',
      appId: 'leancloud应用的appId',
      appKey: 'leancloud应用的appKey'
    }
  }
</script>

引入 CDN

<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/av-min.js"></script>
<script src="//unpkg.com/[email protected]/dist/page-counter.min.js"></script>

总浏览量和当前页面浏览量会自动放入ID为 page-counter-total-timespage-counter-single-times 的DOM元素中。

用法二:npm 引入

安装:

npm install --save page-counter leancloud-storage

使用:

import('leancloud-storage')
  .then(res => {
    // 将 Bomb 对象挂载在 window 上
    window.AV = res.default
    // 设置应用信息
    window.PAGE_COUNTER_CONFIG = {
      serverless: 'leancloud',
      leancloud: {
        history: 0, // 历史访客数量,可不填,默认是0
        table: '存放数据的表格',
        appId: 'leancloud应用的appId',
        appKey: 'leancloud应用的appKey'
      }
    }

    return import('page-counter')
  })
  .then(res => {
    const PageCounter = res.default
    PageCounter.setData() // 发送当前页面数据
    PageCounter.countTotal() // 将总浏览量放入 ID 为 page-counter-total-times 的DOM元素中
    PageCounter.countSingle() // 将当前页面浏览量放入 ID 为 page-counter-single-times 的DOM元素中
  })

Bomb 平台

用法一:CDN 引入

到Bomb控制台查看应用相关信息,将以下代码插入 <head> 标签中:

<script>
  window.PAGE_COUNTER_CONFIG = {
    serverless: 'bomb',
    bomb: {
      history: 0, // 历史访客数量,可不填,默认是0
      table: '存放数据的表格',
      appId: 'Bomb 应用的 Application ID',
      appKey: 'Bomb 应用的 REST API Key'
    }
  }
</script>

引入 CDN

<script src="//unpkg.com/[email protected]/dist/page-counter.bomb-1.6.7.min.js"></script>
<script src="//unpkg.com/[email protected]/dist/page-counter.min.js"></script>

总浏览量和当前页面浏览量会自动放入ID为 page-counter-total-timespage-counter-single-times 的DOM元素中。

用法二:npm 引入

安装:

npm install --save page-counter hydrogen-js-sdk

使用:

import('hydrogen-js-sdk')
  .then(res => {
    // 将 Bomb 对象挂载在 window 上
    window.Bomb = res.default
    // 设置应用信息
    window.PAGE_COUNTER_CONFIG = {
      serverless: 'bomb',
      bomb: {
        history: 0, // 历史访客数量,可不填,默认是0
        table: '存放数据的表格',
        appId: 'Bomb 应用的 Application ID',
        appKey: 'Bomb 应用的 REST API Key'
      }
    }

    return import('page-counter')
  })
  .then(res => {
    const PageCounter = res.default
    PageCounter.setData() // 发送当前页面数据
    PageCounter.countTotal() // 将总浏览量放入 ID 为 page-counter-total-times 的DOM元素中
    PageCounter.countSingle() // 将当前页面浏览量放入 ID 为 page-counter-single-times 的DOM元素中
  })

待做

  • 支持更多的 Serverless 平台
  • 快速本地数据备份

更多

通过以下方式提供新的想法来进一步讨论,也可以直接发起 PR 参与到项目中:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].