Git Product home page Git Product logo

visitor-badge's Introduction

visitor-badge

visitor badge visitor badge

Warning Since Deta will abandon Deta Cloud and move to Deta Space, the deta.dev domain is temporarily closed to users, please change visitor_badge.deta.dev to visitor-badge.imlete.cn

The example service is currently deployed on the free version of Deta, You can visit the /list path to see all the statistics

Inspired by jwenjian/visitor-badge written in Python (PV stats only)

Function

  • PV (Number of visits)
  • UV (Number of visitors)
  • Multi-database selection (mongodb, redis, deta)

Deployment

Deta Free

Deploy with Deta

Server

git clone https://github.com/Lete114/visitor-badge.git visitor-badge

cd visitor-badge

npm run start

ServerLess

See the other branches of the repository for details

Configuration Database

Rename the .env.example file to .env and edit it (just fill in the comments according to the file)

Use

![visitor badge](https://visitor-badge.imlete.cn/?id=github.lete114.visitor-badge)
![visitor badge](https://visitor-badge.imlete.cn/?id=github.lete114.visitor-badge&labelColor=f00)

where id is custom and it is not constrained in any way.

Here are some suggestions

  1. Specify a user's home page, e.g.: https://github.com/Lete114 using id=github.lete114
  2. Specify a user's repository, e.g.: https://github.com/Lete114/visitor-badge using id=github.lete114.visitor-badge
  3. Specify the issues in a user's repository, e.g.: #1 using id=github.lete114.visitor-badge.issues.1
  4. Specify a website, e.g.: https://blog.imlete.cn using id=blog.imlete.cn
  5. Specify a page of a website, e.g.: https://blog.imlete.cn/404.html using id=blog.imlete.cn.404
Key Default Required Options Description
id Page unique ID
type pv ['pv', 'uv'] Statistics type
label visitors Custom label (left) name
labelColor 555 Custom label (left) color (Note: You can leave out the well number #)
color 4c1 Custom stats (right side) color (Note: You can leave out the well number #)
style flat ['plastic', 'flat', 'flat-square', 'for-the-badge', 'social'] Custom badge style

visitor-badge's People

Contributors

lete114 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nqdev-fork

visitor-badge's Issues

关于 UV 统计的问题

visitor badge

在 GitHub 上使用 UV 统计会被 GitHub 的 camo 拦截,导致获取到的 IP 为 camo 服务器的 IP ,所以本项目在GitHub统计UV是不正常的,PV 统计正常

注意: 如果你将 visitor-badge 部署在 Deta 上它的UV统计也无法正常使用,具体请看 (#300) (#282)
因此你可以将 visitor-badge 部署在 Vercel 上 ,UV 统计才会生效 (用在 GitHub 上依然无法生效,它会被 camo 拦截,最终获取到的是 camo 服务器的 IP ,所以 UV 只能统计非 GitHub 网站的 UV)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.