Skip to content

sefinek/moecounter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

136 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”’ MoeCounter.js - The best counters for your projects

npm downloads Issues Last commit jsDelivr stats

MoeCounter.js is a JavaScript library that allows for easy integration of attractive visual counters into your web projects or profiles, such as GitHub. With a variety of appearances and customization options, you can add a unique style to your website or application. MoeCounter is perfectly suited for use as a view counter, visit counter, online user counter, subscriber counter, follower counter, etc. It can be seamlessly used on any website or in applications that utilize WebView2.

πŸ“¦ Installation

NPM (Node.js)

npm install moecounter.js

Browser

<script src="https://cdn.jsdelivr.net/npm/moecounter.js@1/dist/browser/moecounter.min.js"></script>

🌍 Demo

https://sefinek.net/projects/moecounter.js

😸 Counters

Default


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default&pixelated=true

Default Big


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default-big&pixelated=true

Default 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default2&pixelated=true

Default 3


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default3&pixelated=true

Default 3 Big


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default3-big&pixelated=true

Default 4


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default4&pixelated=true

Default 5 Green


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default5-green&pixelated=true

3D Num


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=3d-num&pixelated=true

AI 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=ai-1&pixelated=true

Capoo 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=capoo-1&pixelated=true

Capoo 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=capoo-2&pixelated=true

E621


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=e621&pixelated=true

Food


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=food&pixelated=true

Kasuterura 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=kasuterura-1&pixelated=true

Kasuterura 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=kasuterura-2&pixelated=true

Kasuterura 3


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=kasuterura-3&pixelated=true

Kasuterura 4


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=kasuterura-4&pixelated=true

Love and Deepspace


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=love-and-deepspace&pixelated=true

Miku


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=miku&pixelated=true

Minecraft


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=minecraft&pixelated=true

Morden Num


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=morden-num&pixelated=true

Nixie Tube 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=nixietube-1&pixelated=true

Nixie Tube 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=nixietube-2&pixelated=true

Normal 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=normal-1&pixelated=true

Normal 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=normal-2&pixelated=true

Shimmie2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=shimmie2&pixelated=true

Sketch 1


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=sketch-1&pixelated=true

Sketch 2


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=sketch-2&pixelated=true

Yousa Ling


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=yousa-ling&pixelated=true

Booru - Helltaker


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-helltaker&pixelated=true

Booru - Huggboo


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-huggboo&pixelated=true

Booru - Jaypee


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-jaypee&pixelated=true

Booru - Koe


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-koe&pixelated=true

Booru - Lisu


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-lisu&pixelated=true

Booru - Mof


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-mof&pixelated=true

Booru - Nandroid


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-nandroid&pixelated=true

Booru - R6G Draw Friends


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-r6gdrawfriends&pixelated=true

Booru - Smtg


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-smtg&pixelated=true

Booru - Snyde


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-snyde&pixelated=true

Booru - The Collection


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-the-collection&pixelated=true

Booru - Touhoulat


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-touhoulat&pixelated=true

Booru - Town of Gravity Falls


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-townofgravityfalls&pixelated=true

Booru - Twi Fan Art SFW


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-twifanartsfw&pixelated=true

Booru - VE


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-ve&pixelated=true

Booru - Vivi


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-vivi&pixelated=true

Booru - VP


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-vp&pixelated=true

Booru - Yuyuyui


https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=booru-yuyuyui&pixelated=true

πŸ“ƒ Documentation

moecounter.local(options)

Generates a visual counter based on the provided options. Using the local function, developers have the ability to specify the exact value they want to display on the counter. In such cases, using your own database is recommended. It's important to note that this function has more lenient query limit restrictions (rate limits). For the purposes of displaying any kind of statistics, the BELOW method is preferred.

options

  • number - (default 0): The value you want to display on the counter.
  • length - (default 10): The length of the counter.
  • theme - (default default): The appearance of the counter.
  • pixelated - (default true; recommended true): Should the counter be pixelated?
  • svg - (default false; recommended false): Should the module provide SVG data?

moecounter.remote(options)

In this setup, the API server manages the counter. Developers do not have the capability to modify the counter value. When a user visits a webpage containing the counter (with a link to api.sefinek.net), the counter value will be incremented by 1. An increment is allowed once every 20 minutes from the same IP address. If this limit is exceeded, the server will NOT return any HTTP error, but simply will not increase the counter value.

options

  • name - (required): A unique counter name. It is best to choose a unique name that reflects the purpose of the counter. It's also a good idea to add random characters at the end, e.g., mywebsiteviews-sM7JJb2trEr9.
  • length - (default 10): The length of the counter.
  • theme - (default default): The appearance of the counter.
  • pixelated - (default true; recommended true): Should the counter be pixelated?
  • svg - (default false; recommended false): Should the module provide SVG data?

Important

Remember to inform users that their IP addresses are collected on an external server (api.sefinek.net)! If you use the counter exclusively on GitHub (in repositories, etc.), you do not need to do this.

πŸ€” Example

const moecounter = require('moecounter.js');

const showMoeCounter = async () => {
	const data = await moecounter.local({
		number: 1234567890,
		length: 10,
		theme: 'default',
		pixelated: true,
		svg: false
	});

	console.log(data);
	// Output:
	// {
	// 	url: 'https://api.sefinek.net/api/v2/moecounter?number=1234567890&length=10&theme=default&pixelated=true&svg=false'
	// }
}

showMoeCounter();

Note

If you want to see a sample counter in action, please visit this page.

🍴 Fork

This project is an enhanced fork of journey-ad/Moe-Counter. It features improved rate limit handling and enhanced server-side code quality.

πŸ’™ Thank you

If you like this module, please star ⭐ the repository. If you have any questions or need help, feel free to reach out to me via email or open a new Issue.

πŸ”‘ License

Copyright Β© Sefinek. Licensed under the MIT License.

About

The most effective and efficient moecounters for your projects, designed to display a wide range of statistics for your website and more!

Topics

Resources

License

Stars

Watchers

Forks

Contributors