


javascript - How to set fake page views? And you can't let people see it?
I want to make a fake pageview and display it on the page. The database randomly generates a fake data field, and all randomness is fine. But if what was just uploaded cannot be random, that would be too fake. Currently, it is delayed by one day based on time. But if there are many uploads in one day, and the number of views is all in single digits, how can we reasonably solve this problem? The problem? Suggestions for better solutions are welcome?
Reply content:
I want to make a fake pageview and display it on the page. The database randomly generates a fake data field, and all randomness is fine. But if what was just uploaded cannot be random, that would be too fake. Currently, it is postponed by one day based on time. But if there are many uploads in one day, and the views are all in single digits, how can we reasonably solve this problem? The problem? Any suggestions for better solutions are welcome?
Write a random increment function script. For example, the number of views is 1 at the beginning, and then add a rand within 20 at a certain time (in hours), and loop.
Normal situation:
One click -> One click
Basic cheating:
Click -> A certain number of clicks within the [a, b] range
Intermediate cheating:
[a, b] is a dynamic range, linked to the current total clicks and release time
I once did something similar. The nature of the work was that the website I was on posted some things for the leaders to see for publicity. For performance evaluation, the simplest way is to attract clicks and readings.
But how to make the fake look real? First of all, the most basic point is that the number of clicks follows the law of communication. It is not high at the beginning, but the change will be steeper later.
I wrote a script to record the IDs of recently published articles. Because the date is inherently increasing, I used the date as the base and added some seed, and the formula came out.
Of course, we also need to limit the number of days. I made it 7 days, otherwise the long report and dozens of days of visits would be too hot.
Since we don’t have the function to filter daily growth, there is only a total number, so it’s quite easy to do it.
If you must do this, the random incrementing number will be generated in the background, and the front desk will just display it
Now that the random number field has been designed, it’s no big deal to generate random views when publishing an article! As long as the value you set is not too high, it doesn't matter. You still worry about browsing users seeing it. You have to believe that I am in charge of my website and I will do whatever I want.
Every time a user clicks and the page views +1 is needed, just add a random number, as long as it’s not too exaggerated
In fact, there are two variables, one is the real number of views, and the other is the number of days. As long as these two are combined, a reasonable weight is given.
I don’t understand what this sentence means
Currently, it is postponed by one day according to time, but if there are many uploads in one day, the number of views will be single digits
Give me two suggestions
First, add them randomly when the user browses. This method will look fake when the user refreshes the page multiple times.
2. Create a scheduled task and run the code to increase the number of views every once in a while.
You can increase it more according to the probability, such as 1/10 probability of increasing 100 visits.
You can judge based on the creation time, after how many minutes
|hours
|days
have exceeded the creation time, the God mode will be turned on. As for how to make the numbers beautiful, that is a mathematical problem.
PS: There are many execution methods, such as scheduled tasks, message mechanisms, judging execution in requests, etc.
Just "p" is the fastest

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.
