Coder Social home page Coder Social logo

journey-ad / moe-counter Goto Github PK

View Code? Open in Web Editor NEW
1.2K 7.0 157.0 225 KB

多种风格可选的萌萌计数器

Home Page: https://count.getloli.com/

License: MIT License

JavaScript 62.24% CSS 0.60% Pug 36.42% Dockerfile 0.74%
badge visitors visitor-counter counter

moe-counter's Introduction

Moe-Counter

多种风格可选的萌萌计数器

Moe-Counter

More theme
asoul

asoul

moebooru

moebooru

rule34

Rule34

gelbooru

Gelbooru

Demo

https://count.getloli.com

Usage

Install

Run on Replit

Deploying on your own server

$ git clone https://github.com/journey-ad/Moe-Counter.git
$ cd Moe-Counter
$ yarn install

$ yarn start

Configuration

config.yml

app:
  # site: https://count.getloli.com # your website
  port: 3000

db:
  type: sqlite # sqlite or mongodb

If you use mongodb, you need to specify the environment variable DB_URL

# eg:
export DB_URL=mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count

replit can use Secrets, documentation

DB_URL="mongodb+srv://account:passwd@***.***.***.mongodb.net/db_count"

Credits

License

FOSSA Status

moe-counter's People

Contributors

d1y avatar dependabot[bot] avatar eggplants avatar flazepe avatar fossabot avatar hchenzi avatar journey-ad avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moe-counter's Issues

theme

rule34 考虑 -h 支持嘛

Improve Performance | Make faster!

Hello. I want to suggest one improvments idea for peformance fix.
In your code, it looks like you are insert count to database each count.
If these huge amount of requests it will be cause bad performance.
I did a performance test, and your moe-counter recorded to handles 2,943/s requests.
I tried to imrpove this performacne to make it faster.
What i did, it's simple.

  1. make count saved to cache
  2. save cache to database every 10sec.
    It will improve performance.

I recoded moe-counter from scratch with the improvments. (https://github.com/d1hydr0gen/moe-counter-lite/)
and It recorded to handles 12,550/s requests.
I think these more improvments in my code too.
I hope this helps!

this is my personal message:
i ❤ moe!

乌班图系统部署问题

小白一个,请问乌班图怎么部署
我apt install 后
下一步该咋办,大佬有没有详细一些的教程,感激不尽

大佬 请教一下关于统计数被重置的问题

按照教程允许在 repl.it 上 配置里用的 sqlite数据库 但是发现 网站使用后每天统计数字会被重置从零开始 有时候同一天里也会被重置 从新统计 请问是什么原因呢?

I am about to go insane

I've tried and tried for the past three days, and I still can't figure out what the hell this thing does.
I'm literally about to go insane, I'm begging someone to help me figure this shit out.

mongodb连接问题

export DB_URL=mongodb://admin@localhost/db_count
后启动,mongodb认证失败。

┌─[root@10-255-0-225] - [/home/repos/Moe-counter] - [日 8月 23, 21:57]             
└─[$] <git:(master*)> yarn start
yarn run v1.22.4
$ node index.js
Your app is listening on port 3001
(node:19669) UnhandledPromiseRejectionWarning: MongoError: Authentication failed.
    at MessageStream.messageHandler (/home/repos/Moe-counter/node_modules/mongodb/lib/cmap/connection.js:266:20)
    at MessageStream.emit (events.js:315:20)
    at processIncomingData (/home/repos/Moe-counter/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/home/repos/Moe-counter/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at MessageStream.Writable.write (_stream_writable.js:318:11)
    at Socket.ondata (_stream_readable.js:716:22)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
(node:19669) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19669) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

参照chat-room将db/mongodb.js中7-13行直接改成mongoose.connect(process.env.DB_URL)连接成功。
无其他问题

Ubuntu 18.04
nodejs 12.18.3
mongodb 4.2.9

Potential race condition issues

Hello, I believe your service has some race condition issues.

I tried messing with one of the counters and setting it to a particular value as a joke.

I figured out that the counter works by updating the image every time it is loaded, so I decided to load the image a bunch of times.

For efficiency reasons, I tried parallelizing the process in multiple ways, but the counter would undercount the number of times the image was loaded.

This leads me to believe that your service might have some race condition issues, which you might want to fix.

As of the counter I mentioned, I notified the person who was using it when it reached the value I was targeting, and they were not mad/found it funny if anyone is interested.

I asked them where I could report the issue and they directed me here.

关于图片

请问这些图片是自己设计的吗,做的好可爱,特别是h版本我太喜欢了

计数会不定时重置

直接使用Demo里的链接在刷新几次之后就会重置计数,请问这个是什么原因?这个是必须自己搭建才行吗?

Website down

Hello, the website is down.
I think this was because of a ddos attack

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.