Notice: My personal stance on AI generated artwork. Retweet and share if you agree. Let us discuss, and not immediately scream bloody murder.

Now Viewing: i write a bookmarklet to search in favorite by tags
Keep it civil, do not flame or bait other users. If you notice anything illegal or inappropriate being discussed, contact an administrator or moderator.

andy50312 - Group: Member - Total Posts: 8
user_avatar
i write a bookmarklet to search in favorite by tags
Posted on: 08/14/19 01:48AM

the bookmarklet which i named **gelbooru favorite power** will crawl your favorite images and store in browser local storage.
(i use indexedDb. my 2350 images which is 47 pages take 3.2MB in indexedDb. only store image id, thumbnail url, and tags.)
then you can search by tags in your favorite archive.

i host bookmarklet in jsfiddle: jsfiddle.net/Lyvrc8pw/
and grease monkey user.js in pastebin: pastebin.com/raw/8iKVnqGB#gelbooru-favorite-power.user.js
[SITE STAFF WARNING: This code has not been examined and verified to be safe.]

## usage
### bookmarklet
1. add bookmarklet to your bookmark.
(drag bookmarklet link in to your bookmark list.)
2. go to your gelbooru favorite page,
like gelbooru.com/index.php?pa...s&s=view&id=44004 .
3. click this bookmarklet in you favorite page,
then there will appear a **search bar** and a **update button** .

### user.js
just install it and go to your gelbooru favorite page.
then **search bar** and **update button** will appear.

### using search bar and update button
4. in first use, you need to click update button,
and **gelbooru favorite power** will start crawl all favorite image.
you can inspect the crawl prograss by open dev tool (hit F12).
every page is a single *http get request*.
**gelbooru favorite power** will sleep 6 second after crawl one page.
5. after crawl finish, you can search by type in search bar.
search will start when you stop typing.
6. every time you add new favorite,
click update button to update local archive.



Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 08/14/19 09:15AM

I've redacted the copy of the bookmarklet in the post and put a warning on the link because I'm not comfortable with super-obfuscated javascript code being on the site.

Is there any way you can host it as a non-obfuscated UserJS script instead? Those are trivial to convert to a bookmarklet, and it's much easier for us to verify that they are safe for users.



andy50312 - Group: Member - Total Posts: 8
user_avatar
Posted on: 08/14/19 10:22AM

i post the source code in js fiddle. source code is below the license.
i think bookmarklet is more easy to use, so i does not write in user.js .



Jerl - Group: The Real Administrator - Total Posts: 6706
user_avatar
Posted on: 08/14/19 02:26PM

Bookmarklets are definitely not easier to use; if you post a link to a .user.js file, users with Greasemonkey or Tampermonkey will be able to install them much more easily than creating a bookmarklet. With it installed as a user JS, you don't need to click anything, it just automatically loads it whenever an appropriate page is loaded.



andy50312 - Group: Member - Total Posts: 8
user_avatar
Posted on: 08/14/19 10:46PM

ok, you are right.
this script does only few things during init. major work start when user click update button,
so it is alright to auto execute in every favorite page.

following is the user.js url:
pastebin.com/raw/8iKVnqGB#gelbooru-favorite-power.user.js



add_replyAdd Reply


1