Giter VIP home page Giter VIP logo

worker-counter's Introduction

Counter based on Cloudflare Workers & KV

You are reading the English version readme. 點擊此處閱讀中文自述文檔.

TL;DW (Too Long, Don't write.)

  1. Bind a KV space as CounterSpace.
  2. Bind a domain. the domain will became your counter name-space.
  3. Use it follow down below.

How to use?

Just add these parameters. (don't do it all in one)

  • ?type=visitor returns total visitor count.
  • ?type=hit returns total hits count.
  • ?type=text&text=...(your encoded words)... returns a replaced text (encode your words using btoa(encodeURI("some s*ck words"))).
  • ?type=MoeCounter returns a MoeCounter-like counter SVG, need other parameters (please read it down below :3).

about ?type=text&text=...

  • @CounterByKoto_Visitors will replace to total VISITORS count.
  • @CounterByKoto_Hits will replace to total HITS count.
  • @CounterByKoto_NameSpace will replace to total NAMESPACE.

a example:

https://project.example.dev/?type=text&text=JUU4JUE4JUFBJUU1JTk1JThGJUU0JUJBJUJBJUU2JTk1JUI4OiUyMEBDb3VudGVyQnlLb3RvX1Zpc2l0b3JzLCUyMCVFOCVBOCVBQSVFNSU5NSU4RiVFNiVBQyVBMSVFNiU5NSVCODolMjBAQ291bnRlckJ5S290b19IaXRzLCUyME5hbWVzcGFjZTolMjBAQ291bnRlckJ5S290b19OYW1lU3BhY2UlMEQlMEE=

fetch it, then you will get a response like 訪問人數: 1, 訪問次數: 3, Namespace: example.dev

about ?type=MoeCounter

other parameters

  • theme=...(themeID)... you can find all the available theme in Here

  • value= (hit | visitor | JSON)

    Warn: JSON will return both hit and visitor count SVG (as DataURL, base64 encoded)

a example:

https://project.example.dev/?type=MoeCounter&theme=rule34&value=hit

will get a response like

Example MoeCounter rule34

Readme end, Thanks for your reading.

worker-counter's People

Contributors

kobe-koto avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.