Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Gallery Filecount, Userscript displaying the number of files in a gallery

 
post Nov 24 2013, 23:38
Post #1
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


This was requested many times in the E-Hentai Galleries feature requests, but I have not yet seen userscripts for this. Therefore, here is a userscript to display the number of files in the main pane of galleries. The appearance isn't the most beutiful thing in the world but have a look at the following example (the number of files is after "fc:"):
Attached Image

The script uses the website's API therefore it shall not give you problems of opening too many windows at the same time.

The script is now tracked on github, download it from [github.com] here
But here is the zip for the lazy ones: Attached File  gallery_size.user.js.zip ( 1.47k ) Number of downloads: 184


NOTES:
  • Tested with greasemonkey+firefox only. I was careful to be chrome compliant, but I did not test it. If you find that it does not work in chrome feel free to send me a patch (I don't have an OS that runs chrome without a lot of effort to install it).
  • It shall be trivial to adapt the script to other sites. Just remember to change @include lines and (this is IMPORTANT) to change
    CODE
    var apiurl = "http://g.e-hentai.org/api.php";
    to comply with browser same origin policy.
  • It might fail in some cases when the Paging Enlargement III perk is in effect. This is due to the nature of the API.
  • FIXME: The script depends on the fact that the API response returns the metadata about the galleries in the same order as it was requested, but this fact is NOT specified in the API. If Tenboro changes the API and this becomes not true anymore the script will assign the filecounts to galleries wrongly. This is not a problem right now but it might appear later.

VERY LATE EDIT: this thing is on github: [github.com] https://github.com/neptunepenguin/eh_script...ry-size.user.js (not that i have added any new features recently)

This post has been edited by blue penguin: Dec 8 2015, 04:26
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 02:02
Post #2
Pillowgirl



Grammatically Incorrect (☞゚∀゚)☞
*********
Group: Gold Star Club
Posts: 5,155
Joined: 2-December 12
Level 484 (Godslayer)


I only use the thumbnail view and that already shows the files so this is kinda useless to me, anyway nice work.

What does fc stand for, filecount?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 02:46
Post #3
Drksrpnt



Dank
********
Group: Gold Star Club
Posts: 3,541
Joined: 27-December 10
Level 500 (Ponyslayer)


QUOTE(blue penguin @ Nov 24 2013, 16:38) *
I don't have an OS that runs chrome without a lot of effort to install it


Just use the portable version? It works exactly the same, without the hassle of installing it.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 02:53
Post #4
Pillowgirl



Grammatically Incorrect (☞゚∀゚)☞
*********
Group: Gold Star Club
Posts: 5,155
Joined: 2-December 12
Level 484 (Godslayer)


QUOTE(Drksrpnt @ Nov 25 2013, 10:46) *

Just use the portable version? It works exactly the same, without the hassle of installing it.

He uses Archlinux, installing shit on linux can be...frustrating.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 04:44
Post #5
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


QUOTE(Pillowgirl @ Nov 25 2013, 00:02) *
What does fc stand for, filecount?
yep
QUOTE(Pillowgirl @ Nov 25 2013, 00:53) *
He uses Archlinux, installing shit on linux can be...frustrating.
ekhm... well, yep

Also, I forgot
CODE
// @include http://g.e-hentai.org/?page=*
in the archive above. Whoever uses greasemonkey regularly would figure that out an fix it. But the archive (in first post) is corrected as from this post.

This post has been edited by blue penguin: Nov 25 2013, 04:53
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 06:02
Post #6
Rikis



Bringer of Light
********
Group: Gold Star Club
Posts: 3,679
Joined: 7-July 09
Level 500 (Godslayer)


Doesn't work, when there is 200 galleries (Paging Enlargement III).
QUOTE
[06:08:15.958] apirsp.gmetadata is undefined @ file:///C:/Users/*/AppData/Roaming/Mozilla/Firefox/Profiles/hvxp4xs0.default/gm_scripts/gallery-size/gallery-size.user.js:39


This post has been edited by Rikis: Nov 25 2013, 06:09
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 06:17
Post #7
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


QUOTE(Rikis @ Nov 25 2013, 04:02) *
Doesn't work, when there is 200 galleries (Paging Enlargement III).
Thanks for the confirmation. The API refuses to reply the request because it is too big. But, can I ask you to try with 50 galleries/page as well, please? I suspect it does not work already with 50 galleries.

I might add code for it to work with paging enlargement I and II. Yet the API Tenboro gives us allows for a max 4-5 requests with 25 galleires each so at best the support would be for 125 galleries/page.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 06:52
Post #8
Rikis



Bringer of Light
********
Group: Gold Star Club
Posts: 3,679
Joined: 7-July 09
Level 500 (Godslayer)


Yeah, it does only work with 25.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Nov 25 2013, 07:03
Post #9
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


Thanks Rikis,

I'll add some code to process 50 and 100 galleries per page. But it will need to wait for the next weekend, now I need to sleep to get to work tomorrow.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Dec 1 2013, 06:02
Post #10
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


Updated, it shall work with Paging Enlargement I and Paging Enlargement II perks now. There's a chance that it will work with Paging Enlargement III.

I'd be grateful if someone that have all three perks actually tests it. (pretty please (IMG:[invalid] style_emoticons/default/rolleyes.gif) )
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Dec 1 2013, 07:44
Post #11
Rikis



Bringer of Light
********
Group: Gold Star Club
Posts: 3,679
Joined: 7-July 09
Level 500 (Godslayer)


It does work. Even with 200 results.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11th May 2024 - 04:56