Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> [Script] Gallery List Helper, API information, tag buttons, gallery blacklisting, display fixes, and more

 
post Dec 9 2016, 11:26
Post #1
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


This is something I wrote a while ago to make my vigilante cleanup work easier, but it can be helpful for anyone who wants a better UI on the search results pages.

Attached File  Gallery_List_Helper_1.2.6.user.js.txt ( 22.5k ) Number of downloads: 9368


The short version: This script changes your search results to look something like this
Attached Image
or this
Attached Image

This is extremely useful for both renamers and taggers. (Learn to tag accurately using this. Make renaming much easier by using this (info))

The long version:
  • Given API results from galleries on the page, you can add or exclude tags and perform new searches just by pressing "+" or "-", similar to the interface on [gelbooru.com] gelbooru.
  • You can also add information from the API results to a row below each gallery. It can be anything, but usually you'll want it to be the Japanese title or the gallery tags. (fully customizable, you can read about API options here). Alter displayed text by changing the displayText function in the script (feel free to ask if you don't know Javascript). If you don't want any displayed text, uncomment the return; line in displayText:
    CODE
    function displayText(metadata){
      return;
  • You can remove galleries from the search results if they pass certain conditions, somewhat like Luna_Flina's script, but a lot more flexible. Many examples are given in the script in the testHide function. For example, to prevent "webtoon" galleries from ever being displayed in any search results (including on the front page), you would have
    CODE
    if (metadata.tags.includes('webtoon'))
      hide = true;
    in the testHide function. Look at the examples, but again, if you're trying to do something and don't know Javascript, just ask.
    This allows you to perform more powerful searches within results that aren't currently possible server-side. For instance, using this you could simulate having a title namespace, including or excluding galleries that have a certain phrase in the title. (Having Paging Enlargement really helps)
There are a bunch of moderate display tweaks as well:
  • Gallery rows now reach across the whole page, allowing you to see much more useful information
  • Automatically focuses the search box so you can start typing immediately
  • Removes "new" icons and normalizes the starting X-position of each gallery title
  • Adds padding before gallery titles allowing for much easier copying
  • Visited links are colored green, so you know what you've visited before
  • Lets you right-click other search result pages so you can more easily Open Link In New Tab or something similar
  • Gallery filecount has been added to the "Published" column
To get the most out of this script, you have to customize it depending on your gallery and vigilante habits; sure, you can just install and forget about it, but that's not the best use of the script.

Paging Enlargement is highly recommended for more tag button results, but especially for if you want to do an advanced search within results using the blacklist, in which case <25 galleries/page is often not enough.

If you don't like some of the display changes, feel free to delete the appropriate section from the script. I made all of the changes because I liked them, but I know not everyone will think the same. There are comments before every major section so it should be pretty obvious.

Only works in List display mode. The main point of the script is to increase information density, after all.

Works in at least Firefox (use [www.greasespot.net] Greasemonkey) and Chrome (use [tampermonkey.net] Tampermonkey).

Please tell me if you encounter any bugs, and feel free to ask if you want the script to display (or hide) something but aren't sure how (don't worry, it's almost always very easy).

This post has been edited by Superlatanium: Feb 20 2018, 08:57
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Dec 9 2016, 23:52
Post #2
Simpleton8



Casual Poster
****
Group: Members
Posts: 336
Joined: 2-November 15
Level 264 (Godslayer)


Works great. Thanks.

1) Doesn't work in Fjords? Not just simply adding @include fjord

2) I really like having the tables with the + or - for different tags in order of the number of the galleries. It is also nice information if we want to know the tags associated with specific authors and/or other tags.

3) Considering supporting thumbnail views in the future (or just the tables)? I remembered using a script that display the tags on top of the gallery thumbnails.

4) Perhaps add tables added to the highlighter scripts or vice versa (if that's fine with you) to minimize the number of api calls (?). If I do it, I would add you to the credits. (IMG:[invalid] style_emoticons/default/smile.gif)


--
5) Doesn't remove existing tags by pressing "-" (e.g., ends up looking like group:"kinokonabe hinanjo$" -group:"kinokonabe hinanjo$" instead of just "-group:"kinokonabe hinanjo$")

This post has been edited by Simpleton8: Dec 9 2016, 23:59
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Dec 12 2016, 04:01
Post #3
blue penguin



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


I really like the API/tag display part. 'tis good stuff!

Added to the index.

QUOTE(Simpleton8 @ Dec 9 2016, 21:52) *
1) Doesn't work in Fjords? Not just simply adding @include fjord
Oh, come one, you can figure that one out. Took me 15 seconds (IMG:[invalid] style_emoticons/default/smile.gif)

(although an all caps parameter could be added to the top, e.g. API_URL = 'http:/g.e-hentai.org/api.php')
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 21 2017, 13:14
Post #4
prescott L G



Newcomer
*
Group: Members
Posts: 49
Joined: 18-January 09
Level 206 (Godslayer)


QUOTE(blue penguin @ Dec 11 2016, 20:01) *

Oh, come one, you can figure that one out. Took me 15 seconds (IMG:[invalid] style_emoticons/default/smile.gif)

(although an all caps parameter could be added to the top, e.g. API_URL = 'http:/g.e-hentai.org/api.php')

I tried adding all the expunged gallerie's .org links to the scripts "Include Section" but it still won't work!? What did you do, to get it to work?

This post has been edited by prescott L G: Jan 24 2017, 12:38
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 23 2017, 16:16
Post #5
Simpleton8



Casual Poster
****
Group: Members
Posts: 336
Joined: 2-November 15
Level 264 (Godslayer)


QUOTE(prescott L G @ Jan 21 2017, 13:14) *

I tried adding all the expunged gallerie's .org links to the scripts "Include Section" but it still won't work!? What did you do, to get it to work?


Essentially what I did. Then I realized I wasn't using list mode. (IMG:[invalid] style_emoticons/default/wink.gif)

Just c/p the @include lines and changed one character of each url to fjord's.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 24 2017, 04:26
Post #6
prescott L G



Newcomer
*
Group: Members
Posts: 49
Joined: 18-January 09
Level 206 (Godslayer)


Even when I have it in List Mode, it still doesn't show up!?
Its there on the normal galleries though?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 25 2017, 04:31
Post #7
prescott L G



Newcomer
*
Group: Members
Posts: 49
Joined: 18-January 09
Level 206 (Godslayer)


Nevermind, I figured out why it wasn't working anymore. I think it was because I had "allow paste" still in the script.
It works now! (IMG:[invalid] style_emoticons/default/tongue.gif)

This post has been edited by prescott L G: Jan 25 2017, 04:32
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 26 2017, 10:59
Post #8
prescott L G



Newcomer
*
Group: Members
Posts: 49
Joined: 18-January 09
Level 206 (Godslayer)


Question: When it's on Thumbnail mode, the galleries are moved to the Left side, instead of Centered on the page.
What do I edit to have them Centered?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 26 2017, 11:46
Post #9
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


It was never designed for thumbnail mode, it's meant for list mode only. Though, adding basic functionality for thumbnail mode wouldn't be hard (adding the tag buttons).

Maybe someone who knows more about CSS could do it more easily than me, but here's what you could add after the "Autofocuses the search box" section to center the thumbnails:
CODE
if (document.getElementById('dmi').children[0].textContent == 'Thumbnails'){
  function fix(c){
    var elm = document.getElementsByClassName(c)[0];
    elm.style.maxWidth = '100%';
    elm.style.textAlign = 'center';
  }
  fix('itg');
  fix('ido');
  [].forEach.call(document.getElementsByClassName('id1'), function(id1){
    id1.style.float = 'none';
    id1.style.display = 'inline-block';
    id1.style.height = '335px';
    id1.children[1].style.height = '280px';
  });
  return;
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 26 2017, 12:33
Post #10
TeaAndBiscuits



Newcomer
*
Group: Gold Star Club
Posts: 46
Joined: 19-October 13
Level 237 (Destined)


For simple CSS, add this line to the top of the script (or after the autofocus, as above):

CODE
document.head.appendChild(document.createElement("STYLE")).innerHTML = "div.itg{text-align:center}div.id1{float:none;display:inline-block}";

It'll leave an arbitrary number on the bottom row based on your screen size. To have the normal thumbnails, use this instead:

CODE
if (document.getElementById("dmi").children[0].textContent === "Thumbnails"){
  document.head.appendChild(document.createElement("STYLE")).innerHTML = "div.ido{max-width:1200px!important}div.itg{max-width:1175px!important}";
}


This post has been edited by TeaAndBiscuits: Jan 26 2017, 12:33
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 30 2017, 09:40
Post #11
prescott L G



Newcomer
*
Group: Members
Posts: 49
Joined: 18-January 09
Level 206 (Godslayer)


Removed

This post has been edited by prescott L G: Apr 10 2017, 15:36
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Feb 15 2017, 08:34
Post #12
lolatyoutoo



Newcomer
*
Group: Members
Posts: 31
Joined: 3-March 12
Level 133 (Lord)


Thanks again for the script, I modified the styles a bit to make tag distinction clearer (as well as making it look better overall imo (IMG:[invalid] style_emoticons/default/tongue.gif) )

Attached Image
Attached File  Gallery_List_Helper.user.js.txt ( 21.9k ) Number of downloads: 167


This post has been edited by lolatyoutoo: Feb 15 2017, 08:35
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 19 2017, 05:01
Post #13
Hyoros



Casual Poster
****
Group: Members
Posts: 443
Joined: 24-September 12
Level 63 (Master)


Thank you Superlatanium. It works for me. This will really be helpful for me in future. Now few questions.
I found this from other forum where you said your script can search gallery based on gallery size. How do I do this? Also these -R- on right side. Are they suppose to make a gallery disappear from sight?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 14 2017, 20:28
Post #14
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


QUOTE(Hyoros @ Mar 19 2017, 03:01) *
Thank you Superlatanium. It works for me. This will really be helpful for me in future. Now few questions.
I found this from other forum where you said your script can search gallery based on gallery size. How do I do this? Also these -R- on right side. Are they suppose to make a gallery disappear from sight?
Sorry for late reply, last bump was over 30 days ago so it fell off of my subscribed threads list.

Yes, the R lets you remove rows. (occasionally useful for me when I'm looking at many versions of a similar gallery and want to only pay attention to a select few of them - for example)

You can filter by gallery size with a line similar to the following, in testHide function:
CODE
  if (metadata.filesize < 50000)
    return true;
(This will hide all galleries smaller than 50 MB or so)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 1 2017, 03:31
Post #15
Hyoros



Casual Poster
****
Group: Members
Posts: 443
Joined: 24-September 12
Level 63 (Master)


I tried. Script works but I can still see galleries which size is over 50mb. Which lines do I have to remove?
CODE

//Hides a gallery from all search results if it "returns true" on one of the following tests.
//See full explanation of metadata info at https://ehwiki.org/wiki/API
//Please customize. This allows for much greater search flexibility, especially in combination with Paging Enlargement perk.
function testHide(metadata){
  //examples:
  //if (metadata.tags.indexOf('group') == -1)
    //return true;
  if (metadata.filesize < 50000)
    return true;
-I omitted other examples here for this post-
  /*
  var found = false;
  metadata.tags.forEach(function(tag){
    //if (/parody\:dragon\squest\s/.test(tag))
    //if (/^male/.test(tag))
      found = true;
  });
  if (!found)
    return true;
  */
}


Thank you for quick reply. I saw your reply for a while but I can't find time to test it.

This post has been edited by Hyoros: May 20 2017, 02:52
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 1 2017, 03:58
Post #16
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


https://ehwiki.org/wiki/API
50000 is quite small. Eg https://e-hentai.org/g/618395/0439fa3666/, ordinary size doujin, has 51210504 filesize, or 48.84 MB.

Also, "return true" in that function means that galleries that pass the condition will be hidden. So you'd want something more along the lines of
CODE
if (metadata.filesize > 50000000)
    return true;

To make it more intuitive, you can change the section to something like this:
CODE
function testHide(metadata){
  var hide = false;
  if (metadata.filesize > 50000000)
    hide = true;
  //other stuff...
  //other stuff...
  return hide;
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 24 2017, 15:42
Post #17
exisence



Casual Poster
****
Group: Members
Posts: 285
Joined: 18-January 13
Level 398 (Dovahkiin)


I was just looking for something to customize search results. Thanks Superlatanium.

But i have a question.
Would it be possible to include favcount like fc next to date? Or simply hide posts based on favcount? I checked wiki/api and there is no favcount there. That's probably why it does not simply work.


I saw this AgentLillian post which points that it should be possible to do something with favcount.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post May 25 2017, 04:16
Post #18
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


QUOTE(exisence @ May 24 2017, 13:42) *
I was just looking for something to customize search results. Thanks Superlatanium.

But i have a question.
Would it be possible to include favcount like fc next to date? Or simply hide posts based on favcount? I checked wiki/api and there is no favcount there. That's probably why it does not simply work.
I saw this AgentLillian post which points that it should be possible to do something with favcount.
I asked Luna what he meant but neither of us know a way to get gallery favcount without navigating to each gallery individually, unfortunately (which would be way too hard on the servers for the information it provides).
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Feb 11 2018, 09:54
Post #19
ALL_MIGHT



Becoming addicted to LN and WN
*******
Group: Gold Star Club
Posts: 1,548
Joined: 14-October 16
Level 460 (Godslayer)


Hi,
I Just installed it (did not make any changes to default script),
but i am not able to use + and - options. whenever i click them nothing happens

and in console these errors gets generated
Screenshot is
Attached Image

Do i have to make some changes in script to use them?
If yes, how can i add my desired tag in them.
(I am total dumb when it comes to scripts)

thanks
(IMG:[invalid] style_emoticons/default/biggrin.gif)

This post has been edited by ALL_MIGHT: Feb 11 2018, 10:00
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Feb 11 2018, 10:32
Post #20
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,593
Joined: 27-November 13
Level 500 (Godslayer)


Not your fault, the recent update broke it, should be fixed now in the version I just posted. (IMG:[invalid] style_emoticons/default/smile.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


2 Pages V  1 2 >
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: 1st April 2025 - 05:25