[17:28:10] cscott: ping again :) I'll email soon if this doesn't work [22:53:29] is there a way that I can view the template source for a template on commons? [22:54:12] it seems highly abbreviated when I go to "view source" [22:54:16] I'm looking at: https://commons.wikimedia.org/wiki/Template:Book [22:54:39] https://commons.wikimedia.org/wiki/Module:Artwork [22:55:29] #invoke means it's a scribunto module [22:58:19] hrm ok [22:59:15] this is useful to know but I think it's not quite what I'm looking for -- I think what I want is in the IA template, where it indicates which internet archive item was the source of the commons upload [22:59:40] that template includes this: [[iarchive:{{{1|}}}|{{lang|en|Internet Archive identifier|tag=span}}: {{{1|}}}]] [22:59:45] is iarchive a namespace? [23:00:01] I think it's an interwiki link [23:00:18] As per https://commons.wikimedia.org/wiki/Special:Interwiki [23:00:22] /archive.org/details/$1 [23:00:24] //archive.org/details/$1 [23:00:43] oh right [23:00:47] ok interesting [23:02:55] so basically, I'd like to know if I can use api.php to query for wiki pages that contain a particular interwiki link to an IA item [23:03:06] I guess that means matching against the wikitext of pages on the wiki? [23:03:34] basically the point is to check -- has this IA item been uploaded to commons before, under any filename? [23:04:09] and this seems like the main place it's indicated in the wikitext, the Source param to {{Book}} [23:04:23] which is {{IA|foo}} where foo is the IA identifier, which becomes that [[iarchive:foo]] link [23:04:34] I could just search the text for {{IA|foo}} of course [23:05:08] it also occurs as {{Internet Archive link|foo}} [23:06:13] I'd be trying to find out if it ends up extracted as more structured data [23:06:21] like, in the external links and interwiki links [23:06:53] well it probably does, yes [23:07:01] but how do I match against those pages? [23:07:27] Well, if interwikis are tracked.. [23:07:31] https://commons.wikimedia.org/w/api.php?action=help&modules=query%2Biwbacklinks [23:07:33] >Find all pages that link to the given interwiki link. [23:07:48] external links is a bit harder [23:07:50] I just found that [23:07:59] let me give it a try [23:09:16] yes, it does seem to work [23:09:58] it'll be more robust than weird indirection and such [23:11:13] ah I see, the IA template doesn't exist on commons beta so it doesn't get captured there [23:11:18] but on main commons it's fine [23:16:01] ok, well this is pretty easy to check. so just a question of whether to do the check or not from ia-upload [23:16:37] I dunno if there's a case where, say, someone uploaded a djvu and now they want the pdf instead. I dunno if procedure there would be to have 2 files or to somehow rename/replace the djvu [23:16:47] ningu: I think that with https://commons.wikimedia.beta.wmflabs.org/wiki/Special:Import it would be possible to import missing templates and modules from commons for your testing [23:16:59] bd808: ah cool, I can try that, thanks [23:17:16] nah it says I don't have permission [23:17:32] I was about to say that if you need more rights, shout :) [23:17:33] beta commons's Template:Book is also a bit out of date (not a big deal for testing though) [23:17:44] "The action you have requested is limited to users in one of the groups: Administrators, Importers, Transwiki importers. [23:17:54] ah wait [23:18:03] it had logged me out, one sec [23:18:04] Let's see what super powers I have on betacommons... [23:18:27] ok yeah, same error [23:19:17] ningu: what's your username on betacommons? [23:19:20] Lautgesetz [23:20:23] * bd808 puts the Importer and Transwiki importer hats on Lautgesetz [23:20:42] haha ok, thanks [23:21:11] glad to give you sysop too if you end up needing it [23:21:36] nah [23:21:38] but thanks [23:21:55] ok so I say import from another wiki, that wiki being commons, import Template:Book, into namespace Template? [23:22:17] etc [23:22:58] "Import to default locations" for the where and "Include all templates" in the section above that to get the chained things [23:23:13] ok [23:25:26] that seems to have worked. yay: https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&list=iwbacklinks&iwblprefix=iarchive&iwbltitle=carcan-kucing [23:26:09] still seeing wikidata error for {{Book}} though: https://commons.wikimedia.beta.wmflabs.org/wiki/File:Carcan-kucing.djvu [23:26:26] that might be cause of missing extensions or something. not important enough for what I'm doing to worry about really [23:26:55] the "Unexpected < operator" is confusing to me though [23:31:38] ningu: that looks like a lua error message [23:32:40] Did you import all the dependant Modules? [23:32:49] I checked the box that bd808 mentioned [23:33:09] It looks like you have from https://commons.wikimedia.beta.wmflabs.org/wiki/Special:Contributions/Lautgesetz [23:33:59] yeah, it imported a bunch of those, some unchanged but others not [23:37:32] ugh. how do I get the 2010 editor instead of VE's "source" mode? [23:38:52] found it :) I had all beta features turned on [23:42:29] hmm.. the error is somewhere in a template I guess. If I remove all of the `<` chars from the source page the error is still there. [23:43:32] it doesn't seem to matter on commons though, just betacommons [23:43:44] unless I am missing something [23:43:55] the error message comes from https://commons.wikimedia.beta.wmflabs.org/wiki/Module:TemplatePar [23:44:12] but I'm not bored enough to trace how it is actually called :) [23:44:20] hehe [23:45:08] It's out of date against upsream [23:45:29] I'd import the commons version [23:46:39] which is slightly odd when the revision on beta is years later