Danbooru

[Userscript] Twitter Image Searches and Stuff

Posted under General

Twitter Image Searches and Stuff (TISAS) searches Danbooru database for tweet IDs, adds image search links, and highlights images based on Tweet favorites.

It is based off the idea of the popular userscript Pixiv Image Searches and Stuff (PISAS, About:Userscripts).

Installation

Project page
Main script

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

Updates

This script was transferred from the Beta release published on Discord.

https://gist.github.com/BrokenEagle/dd9445d7e83d136716bb742228e50259

@fredgido helped Beta it and provided multiple suggestions and feedback.

NOTE: The database scheme was altered from the beta to the production, and is now stored in a different location. To transfer the database, export the database using the beta (1.0-1.13), and then import it using the production (2.0+).

Screenshots
Usage notes

Final

Any suggestions or feedback is appreciated.

Latest edits

  • (2019-08-29)
    • Version 7
      • Confirmation dialog on IQDB search
      • User setting for tweet stats display
      • Hide controls for disabled settings
      • Renamed "Database settings" to "Query settings"
      • Optimized display of Twitter thumbnails

Versions

Updated

Minor versions
  • (2019-03-05)
    • 2.1
      • Fixed post info not loading onto tooltips in some cases
  • (2019-03-06)
    • 2.2
      • Fixed fade/hide stylings not being removed correctly sometimes
  • (2019-03-07)
    • 2.3
      • Fixed Tweet menu from being rendered on videos
    • 2.4
      • Added help links to Tweet menu
      • Rerenders the Tweet menu on match/deletion
      • Consistent left click behaviors
      • Don't render advanced tooltips when autosave IQDB is enabled

Updated

Pushed Version 3 which adds an auto-click function to "Check IQDB" and also a function to manually catch the database up to current.

Since the auto-click can be network intensive, it has been restricted in several ways:

  • Must be enabled in the settings menu
  • Must be enabled in the side menu (for each artist)
    • This was done because some artists upload a lot of garbage
  • Only available in certain views
    • Individual tweet view
    • Artist media timeline
    • Search timeline when the from: and filter:images metatags are used
  • IQDB misses are stored for a day
    • Misses can be manually reset

The function to manually have the database caught up can be accessed by clicking the "Current records" link in the side menu. If it is "Up to date", then clicking will do nothing.

Minor versions
  • (2019-03-15)
    • 3.1
      • Added age to post tooltips
  • (2019-03-16)
    • 3.2
      • Added Upload link to Danbooru on image popups
  • (2019-03-17)
    • 3.3
      • Started migration from using account names to user IDs
        • This is because the account name can change, but the user ID cannot
      • Optimized several UI controls so there's little delay in changing the display
  • (2019-03-18)
    • 3.4
      • Fixed bug with media navigation link
      • Added a more aggressive transition to user IDs

Updated

Pushed Version 4 which primarily adds advanced tooltips to all postlinks, whereas before it was just IQDB matches. Additionally, the new advanced tooltips for both IQDB and regular postlinks have selectable thumbnails. On IQDB postlinks, selecting a thumbnails removes that post as an IQDB match from consideration. On regular postlinks, selecting a thumbnails sets up that post as a candidate for deletions. Still though, to complete the action, the postlink must be clicked and the postlist it presents must be confirmed.

Besides the tooltips, the fade/hide scheme for artist highlights was revised. Each level is no longer individually selectable. Instead the level selected represents the default cutoff (inclusive) for what levels will be faded/hidden. The "excellent" level is not an option, and the "poor" level is the bare minimum.

The above change allows the current fade/hide levels to be changed dynamically on the page. This can be done by other clicking the supplied links, or using the provided hotkeys. The current level for both stylings are shown in the side menu.

Type Decrease Increase
Fade Alt + - Alt + =
Hide Alt + [ Alt + ]

Note: Artist highlights are still only available on the media timeline, and on the search timeline when the from: and filter:images metatags are used.

Minor versions
  • (2019-03-20)
    • 4.1
      • Fixed bug where Tweet indicator controls weren't being hidden on the Tweet view when disabled
  • (2019-04-02)
    • 4.2
      • Fixed user ID not being normalized to string
        • Caused the settings to not be saved for no highlights and auto IQDB
      • Prevent duplicate Tweet IDs from being saved
  • (2019-04-16)
    • 4.3
      • Fixed score highlighting not working with low window sizes

Updated

Pushed Version 5 which has several new additions.

  • Inter-tab communication:
    • Changes on one tab get reflected in other tabs.
  • Instant settings changes:
    • Beforehand most changes in the main menu required a page refresh.
  • Increased side-menu functionality:
    • Set record position to latest. This will skip change records.
    • Manually query the current record count.
  • Altered side-menu layout:
    • Items now line up better.
    • Help text has been segregated into "?" hover/click links.
  • Additional hotkeys:
    • Alt+S to save main menu settings.
    • Alt+R for factory reset.
  • Reset control for lists:
    • In the main menu.
    • Factory Reset does not do this.
  • Original image information:
    • Size/dimension on upload links.
  • Tweet statistics:
    • Available on every timeline.
    • Can be filtered by retweet, or tweet type (image, video, text).
  • More feedback messages
Minor versions
  • (2019-04-22)
    • 5.1
      • Added more feedback to help with installation <fredgido: Discord>
      • Removed dependency on fonts with the -/+ icons in the side menu
      • Use page refresh for database install/upgrades instead
      • Fix initialization of current records timestamp and broadcast to other tabs
      • Fixed HTML escaping function
      • Rework purge of bad tweets
  • (2019-04-23)
    • 5.2
      • Updated to latest version of library
      • Reduced code size by ~10%
  • (2019-04-24)
    • 5.3
      • Refactored code to separate text from functions

Updated

Pushed Version 6 that primarily adds support for Twitter videos, which work pretty much the same as image tweets. For the download links (when enabled), it presents an image link for the thumbnail image and the video link for the highest quality video version available.

Minor versions
  • (2019-04-22)
    • 6.1
      • Fixed age string for low intervals
      • Add use of "only" parameter
        • Should on average make network requests faster
    • 6.2 - Fixed bug with re-rendering after settings change
  • (2019-05-14)
    • 6.3 - Fixed upgrade message

Updated

Pushed Version 7 which has a few new additions.

  • Confirmation dialog on IQDB search
    • Activates only on multi-image tweets
    • Does not activate when auto-clicked
    • Can be turned off with a user setting
  • User setting for tweet stats display
    • Disabling it hides that table
  • Hide controls for disabled settings
    • Includes the following settings/controls:
      • "Score highlights enabled" -> "Artist highlight controls"
        • "Artist highlights enabled" -> "Fade level controls"
        • "Artist highlights enabled" -> "Hide level controls"
      • "Autoclick IQDB enabled" -> "Autoclick IQDB controls"
      • "Tweet indicators enabled -> "Tweet indicator controls"
  • Renamed "Database settings" to "Query settings"
  • Optimized display of Twitter thumbnails
  • 1