[02:18:35] [telegram] 🤝🤝🤝🤝🤝🤝🤝🤝🤝🤝🤝https://t.me/Welcomeinvestor : https://tools-static.wmflabs.org/bridgebot/247cbf08/file_1260.jpg [02:20:43] [telegram] https://t.me/Welcomeinvestor : https://tools-static.wmflabs.org/bridgebot/27938c24/file_1261.jpg [03:39:36] [telegram] TG群发,私聊,在线,增粉;三万优质中文群全网监听服务限时特价;需要请咨询 : https://tools-static.wmflabs.org/bridgebot/85df9be3/file_1266.jpg [19:48:59] [telegram] Forwarded from jhsoby: Does anyone know a way to find duplicate image uses in an article? For instance if an image is used in the infobox (from Wikidata), but is also used elsewhere in the article (from wikitext) [19:56:00] [telegram] I… have no idea, sorry, but if you get an answer @jhsoby that also interests me! [20:02:55] [telegram] is the number of images/media in a page tracked somewhere? then you could maybe compare that against number of imagelinks/globalimagelinks entries (because duplicate images would only have one link row) [20:03:17] [telegram] that’s the only idea I’ve had so far (apart from changing MediaWiki to track duplicate images as it parses the page) [20:04:06] [telegram] (I found no number of images in page_props or ?action=info though) [20:04:40] [telegram] While checking the API trying to find a way to answer my own question, I immediately came across a problem with this: there are very very many legitimate uses of duplicate images. Like flag icons (re @lucaswerkmeister: that’s the only idea I’ve had so far (apart from changing MediaWiki to track duplicate images as it parses the page)) [20:04:54] [telegram] ah. very true [20:07:11] [telegram] can Lua modules access the whole wikitext of an article? If so, that could be used to add a tracking category if an image that is included from Wikidata is also used in an article [20:07:25] [telegram] can Lua modules access the whole wikitext of an article? If so, that could be used to add a tracking category if an image that is included from Wikidata is also used in the wikitext [20:07:26] [telegram] I believe they can, yes [20:07:47] [telegram] IIRC that’s how the “article uses dmy/mdy” templates on enwiki work [20:08:02] [telegram] ah, interesting [20:12:37] [telegram] found it! search for has_use_xxx_dates in https://en.wikipedia.org/wiki/Module:Ref_info and marvel at it [20:14:04] [telegram] I also found it in [[en:Module:Citation/CS1/Configuration]] (search for df_template_patterns) 😁 [20:14:30] [telegram] I sure hope those two lists of patterns are in sync :) [20:14:31] [telegram] local content = mw.title.getCurrentTitle():getContent() or ''; [20:14:33] [telegram] Seems to easy to be true 😜 [20:14:51] [telegram] (narrator: they are not) (re @lucaswerkmeister: I sure hope those two lists of patterns are in sync :)) [20:15:12] [telegram] 🤣 [21:13:56] [telegram] I don't know much about it, there is a feature in WPCleaner which identifiers duplicate links present in an article. I think the specific owner will be able to process this request I guess [21:48:26] [telegram] But it is tricky. For example File:Example.png can be used on ukwiki as Файл:Example.png, File:Example.png, Image:Example.png, Зображення:Example.png, and then also any number of space characters before and after :, and then also any combination of first letters in namespace and image names being capital or not. And then uses through templates indirectly (like flag icons mostly are) (re @jhsoby: can Lua modules [21:49:18] [telegram] Lua doen't have full fledged regexes, does it? [21:50:02] [telegram] Ah, there is some lua patterns thingie [21:50:37] [telegram] we can just ignore the namespace, the filename (including extension) is very unlikely to be used in any other context. maybe check for filename and filename.replace(" ","_") (whatever that is in Lua, I'd have to look it up) (re @Thecladis: But it is tricky. For example File:Example.png can be used on ukwiki as Файл:Example.png, File:Example.png, Image:Example.png, Зображення:Example.png, and then also any number of [21:51:11] [telegram] Oh yeah indeed, also spaces/underscores [21:56:54] [telegram] now my main challenge is this: The module that is mainly used to add images from Wikidata in the Norwegian Bokmål Wikipedia, [[w:no:Module:WikidataBilde]], basically just returns the filename. I.e. when you use it you would do something like [[File:{{#invoke:Wikidatabilde|velgbilde}}|200px]]. So how can I make that add a tracking category without messing up the wiki syntax? Spoiler: [[File:Example.png[[Category:Tracking categor [21:57:14] [telegram] /delete@wikilinksbot [21:57:26] [telegram] [[w:no:Modul:WikidataBilde]] [22:02:11] [telegram] Perhaps add an html comment instead? And then look it up somehow else, perhaps through search