Donmai

[Userscript] IQDB4Chan

Posted under General

IQDB4Chan adds a link in images threads under the thread title (ex. "/e/ - Ecchi"). The link is labeled IQDB Check. Clicking this will check every thumbnail against Danbooru's IQDB database. Misses get surrounded with a red border and hits get post links to Danbooru added.

Installation

Project page
Main script

https://raw.githubusercontent.com/BrokenEagle/JavaScripts/stable/iqdb4chan.user.js

Final

I created this script mostly because I found it annoying having to repeatedly spam the IQDB search link for multiple images in a thread. With the above, you can immediately see what has and hasn't been uploaded, allowing one to focus on those images that interest the user.

If you have any suggestions for the placement of the links or the styles used, or want to see something else added, please feel free to chime in.

Change log

  • (2017-09-18) Version 3 <ref chinatsu: forum #136103>
    • Added CSS class to post links
    • Post links now open in new tab
  • (2017-11-22) Version 4 <ref chinatsu:forum #136103>
    • Added CSS class/color to links based upon IQDB score
  • (2018-01-21) Version 5 <ref nonamethanks:Discord>
    • Fixed incompatibilities with the latest versions of Greasemonkey/Tampermonkey

Updated

Can you add a class to the links so I can style them as a different color? For instance light green similar to the Pixiv IQDB checker. And would it be possible to have a class for the level or accuracy of the match? Oh and opening in a new tab.q

Updated

chinatsu said:

Can you add a class to the links so I can style them as a different color? For instance light green similar to the Pixiv IQDB checker. And would it be possible to have a class for the level or accuracy of the match? Oh and opening in a new tab.q

I updated the links with a class and made it so that they open in a new tab.

Unfortunately, Danbooru's IQDB services doesn't currently give back the similarity percentage, and I don't want to use IQDB.org as it will IP ban you for an hour if you send to many requests in a certain time period. I haven't tested it yet, but SauceNao.com may do the same.

Though I did create issue #3306, which will add the similarity percentage in the response, in addition to allowing the minimum similarity percentage to be specified.

BrokenEagle98 said:

I updated the links with a class and made it so that they open in a new tab.

Unfortunately, Danbooru's IQDB services doesn't currently give back the similarity percentage, and I don't want to use IQDB.org as it will IP ban you for an hour if you send to many requests in a certain time period. I haven't tested it yet, but SauceNao.com may do the same.

Though I did create issue #3306, which will add the similarity percentage in the response, in addition to allowing the minimum similarity percentage to be specified.

Well SauceNAO does have API keys, Might be a lot more work but it's possible. You pay for the access so it would not be leaching. I can give you access to my key if you need it for anything, related to this or otherwsie

chinatsu said:

Well SauceNAO does have API keys, Might be a lot more work but it's possible. You pay for the access so it would not be leaching. I can give you access to my key if you need it for anything, related to this or otherwsie

Well, I could always add in a configuration option to allow the usage of SauceNao instead. It may take a few days depending on how easy it is to add in.

Pushed Version 4. Thanks to the resolution of issue #3306, I was able to add colored links and CSS classes to the post links.

The following is the current configuration:

  • Class: very-high-similarity
    • Default color: green
    • Score range: 95-100%
  • Class: high-similarity
    • Default color: blue
    • Score range: 90-95%
  • Class: medium-high-similarity
    • Default color: orange
    • Score range: 85-90&%
  • Class: medium-similarity
    • Default color: red
    • Score range: 80-85%
1