{"id":823,"date":"2026-05-01T21:18:48","date_gmt":"2026-05-01T20:18:48","guid":{"rendered":"http:\/\/magnusmanske.de\/wordpress\/?p=823"},"modified":"2026-05-01T21:18:48","modified_gmt":"2026-05-01T20:18:48","slug":"tools-united","status":"publish","type":"post","link":"http:\/\/magnusmanske.de\/wordpress\/archives\/823","title":{"rendered":"Tools United"},"content":{"rendered":"<p>Some of my tools are JavaScript scripts on Wikidata. They are added by users on their <a href=\"https:\/\/www.wikidata.org\/wiki\/Special:MyPage\/common.js\">commons.js page<\/a> and run in their web browser when browsing Wikidata. I have about a dozen of them, of various ages. Some of them I had updated <a href=\"http:\/\/magnusmanske.de\/wordpress\/archives\/672\">four years ago<\/a>, and put a &#8220;shared library&#8221; sort-of-thing in place.<\/p>\n<p>One thing that always happens with these scripts is that I start developing them in a nice editor on toolforge, but once they reach a certain maturity, I put them on a Wikidata &#8220;code page&#8221;, announce them, fix the inevitable bug or two, and then leave them be; it is too awkward to copy them into the Toolforge file again, switch the include to Toolforge, work on it, and then switch everything back, just to be able to edit in a decent editor.<\/p>\n<p>Using my own scripts on a daily basis, I had accumulated a few things that bugged (see what I did there?) me, and I decided to do something about it. And then I paused and did something bigger. I took my &#8220;shared library&#8221;, and the (still working) scripts, and put them <strong><a href=\"https:\/\/codeberg.org\/magnusmanske\/wikidata_utils\">in a repo<\/a><\/strong> on codeberg. I also wrote a Python script that can sync between Wikidata and the local repo. I can now use my trusty editor (<a href=\"https:\/\/zed.dev\/\">Zed<\/a>) to edit files, push them to repo, and to Wikidata, with one line. I also put a decent README that briefly describes the tools. As a side effect, I now offer the <a href=\"https:\/\/codeberg.org\/magnusmanske\/wikidata_utils\/issues\">issue tracker<\/a> to file bug reports and feature requests; I hope this gets take up over &#8220;adding it to some talk page&#8221; where it is too easily forgotten.<\/p>\n<p>Now, what did I do with this awesome power? Mostly things behind the scenes. One visible change is how statements get added to the Wikidata interface (DOM). Until now, I just added statement-lookalike boxes as placeholders, but they were just Potemkin&#8217;s <tt>&lt;div&gt;<\/tt>s; they could not be edited, had no references, no new references could be drag&#8217;n&#8217;dropped on them, etc. Now, I am using the (officially undocumented) Wikibase JS functions to add new statements, so they become not only visible immediately, but are working, usable members of the statement society, as if I had added them manually, with keystrokes, like some caveman. And if this undocumented hack ceases to function one day, it will just fall back on the previous, display-only version.<\/p>\n<p>I hope this will future-proof the scripts, at least for a while, and maybe even tempt others to <a href=\"https:\/\/codeberg.org\/magnusmanske\/wikidata_utils\/src\/branch\/main\/HOWTO.md\">use the &#8220;shared library&#8221;<\/a> in their own scripts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some of my tools are JavaScript scripts on Wikidata. They are added by users on their commons.js page and run in their web browser when browsing Wikidata. I have about a dozen of them, of various ages. Some of them I had updated four years ago, and put a &#8220;shared library&#8221; sort-of-thing in place. One [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-823","post","type-post","status-publish","format-standard","hentry","category-wikidata"],"_links":{"self":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/comments?post=823"}],"version-history":[{"count":3,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/823\/revisions"}],"predecessor-version":[{"id":826,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/823\/revisions\/826"}],"wp:attachment":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/media?parent=823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/categories?post=823"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/tags?post=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}