fuddl / wd

a browser extension for wikidata
https://wikidata.org/wiki/Wikidata:Tools/Wikidata_for_Firefox
GNU General Public License v3.0
36 stars 6 forks source link

Feature request: scan page and highlight links that are not yet linked to wikidata #128

Closed davidscotson closed 9 months ago

davidscotson commented 10 months ago

If you visit a page on say https://www.librarything.com/ about a book, the addon will indicate whether or not that book is currently connected via librarything work id to Wikidata, and allow you to connect them if not.

The site also has various pages that have lists of books (trilogies, award winners, books by a specific author etc.) each book linking to the specific page on that book. It would be nice to be able to hit a button on a list page and be able to see which of the books linked from that page don't have connections to Wikidata without visiting each page in turn.

There is a workaround that achieves this currently:

  1. Add a fake Q item to the url e.g. #wd:Q4115189
  2. Open the Wikidata sidebar and scroll down and select "Add a statement, extract data from this website"
  3. Links that are already matched will have green balloons next to them, links that are not yet matched will have the relevant property and the extracted id a gray balloon.
  4. You can right-click and open the unmatched links in new tabs, then visit them in turn to continue with the normal workflow.
fuddl commented 10 months ago

i would like this feature too and would have recommended precisely your workaround in lack of a better method. 🤷

The thing is, resolving potentially hundreds of links on a website is computationally expensive and takes a lot of time. So I couldn't run it on every page without knowing if it is nessesary.

How would you like to access this feature?

davidscotson commented 10 months ago

I was thinking just a button/link to press near the top or bottom of the sidebar that would say something like "scan page for connections" that would then activate the current workaround, and maybe show a special page in the sidebar and prevent even accidentally adding content to the wikidata sandbox item.

Currently the speed of link checking seems fine for me for manually triggered use, though it depends a little on how many spurious links the page has. I believe there's some kind of caching so presumably standard links in page footers etc. wouldn't need checked twice.

One minor change in this mode that would be nice would be if the gray bubbles were set to be clickable links that opened the associated link in a new tab. In normal use they're set up for adding the item to the sidebar and so aren't real links. I currently right-click the associated link to do this, but something about the bubble makes me want to click on it so I do it by mistake a lot.

fuddl commented 9 months ago

@davidscotson So the adder dialog gets this new contextual action currently named Highlight wikidata links, let me know if you have a better name for this.

When clicked, it appends a link to each link that displays the Wikidata ID. It can be clicked or right clicked like any old link but the text is not selectable.

Sidebar Main window

Every link without this appendix is not on wikidata yet.

You should be able to try it in the latest commit.

davidscotson commented 9 months ago

That works well, thanks!