Hypnohub Popular Query Generator
Hi everyone!
Ever since Hypnohub migrated to the newer booru software, one feature that I've missed a lot is the Popular feature, which displays daily, weekly, and monthly popular posts. I've come across some workarounds, but they require a significant amount of effort.
Because of that, I've created a website that automatically generates popular queries, so you don't have to! It is located at:
>>> popularhypnohub.diamondx.pet <<<
To use it, simply choose one of the three buttons: "Daily Popular," "Weekly Popular," or "Monthly Popular," and a query will be generated. Clicking the spiral button will take you directly to Hypnohub.
--- Nerdy details below! ---
The service internally uses the Hypnohub API. It is also heavily cached: a daily query is generated only once a day at most, and each cache miss should perform only a handful (around 20 max) of requests, so it really should not introduce a lot more traffic.
The service works by utilizing binary searching. It starts off at an arbitrarily high page number, then divides the posts in half repeatedly until it finds a post that roughly matches the "daily," "weekly," or "monthly" mark. The time complexity for this is O(log_2 n) with some optimizations, so for 5000 posts, only a maximum of 12 requests are needed.
The project is completely open source and available on GitHub at github.com/diamondburned/hypnoview. If you like the project and are on GitHub, feel free to give it a star!
Ever since Hypnohub migrated to the newer booru software, one feature that I've missed a lot is the Popular feature, which displays daily, weekly, and monthly popular posts. I've come across some workarounds, but they require a significant amount of effort.
Because of that, I've created a website that automatically generates popular queries, so you don't have to! It is located at:
>>> popularhypnohub.diamondx.pet <<<
To use it, simply choose one of the three buttons: "Daily Popular," "Weekly Popular," or "Monthly Popular," and a query will be generated. Clicking the spiral button will take you directly to Hypnohub.
--- Nerdy details below! ---
The service internally uses the Hypnohub API. It is also heavily cached: a daily query is generated only once a day at most, and each cache miss should perform only a handful (around 20 max) of requests, so it really should not introduce a lot more traffic.
The service works by utilizing binary searching. It starts off at an arbitrarily high page number, then divides the posts in half repeatedly until it finds a post that roughly matches the "daily," "weekly," or "monthly" mark. The time complexity for this is O(log_2 n) with some optimizations, so for 5000 posts, only a maximum of 12 requests are needed.
The project is completely open source and available on GitHub at github.com/diamondburned/hypnoview. If you like the project and are on GitHub, feel free to give it a star!