Tech

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

A place to talk about tech of wikis.

Got a wiki or WMF technical question? Ask here. This can include:

  • requests for new tools, scripts, and bots;
  • help with CSS or JavaScript;
  • API help;
  • and data collection help (including database queries).

This isn't an exhaustive list. Posts here should be about tech that's related to a Wikimedia wiki.

Contents

[edit] Discussion on account security

There is currently a discussion on account security here. Any developers or interested users should participate. fetchcomms 17:13, 3 June 2011 (UTC)

[edit] Help with checker tool

Does anybody know how can I use the checker tool on Portuguese Wikisource? I've tried to use it with the page s:pt:Galeria:Elementos de Arithmetica.djvu but it didn't work. Compare with the result corresponding to s:Index:A Book of Dartmoor.djvu. Helder 14:49, 8 June 2011 (UTC)

That seems like an MZM type question. I couldn't get it to shake anything loose. As there are a number of differences between how each of the wikis implemented the proofread system that it is either a name or namespace issue, or one of the host of quirks of difference. billinghurst sDrewth 12:15, 13 June 2011 (UTC)
I sort of fixed this for ptwikisource, but the whole system is pretty much broken (links are still broken in checker). I think some MediaWiki changes are needed to make this sane. The Wikisources are completely neglected.... --MZMcBride 06:31, 14 June 2011 (UTC)
Okay, I've now rewritten the tool to work around the horribleness of the Proofread Page extension. I filed bugzilla:29396 to track the issues I encountered. sDrewth and Helder: Let me know how this works now. --MZMcBride 17:21, 14 June 2011 (UTC)
Thank you very much! It seems to be working now. =D Helder 19:43, 14 June 2011 (UTC)

[edit] Needing help to get button functionality for the new Extension:WikiEditor toolbar

WMF has set the default toolbar for enWS to be the Extension:WikiEditor, and presumably the others, and it is problematic as the functionality of certain buttons is encoded in proofread.js. From my uneducated reading of the code, the functions behind those buttons cannot be called external from the script.

Aside from that the code of the editor does not show how to run an application and just shows how one to encapsulate text. m:Extension:WikiEditor/Toolbar_customization. Am I missing something? billinghurst sDrewth 14:29, 19 June 2011 (UTC)

Try something like this:
$( function() {
        $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
                'section': 'main',
                'group': 'insert',
                'tools': {
                        'my-test': {
                                label: 'Just a test',
                                type: 'button',
                                icon: 'http://upload.wikimedia.org/wikipedia/commons/2/27/Vector_toolbar_signature_button.png',
                                action: {
                                        type: 'callback',
                                        execute: function() {
                                                //Do something
                                                alert('Done!');
                                        }
                                }
                        }
                }
        } );
} );
Helder 15:38, 19 June 2011 (UTC)
The link you mentioned (mw: Extension:WikiEditor/Toolbar_customization) does include a brief example of how to use the API, however it's more advanced than the old toolbar. It has many new features that people have asked for over the years and have partially worked around with local scripts and hacks. As a result the API may have become more complicated for 'simple buttons'. However this can be solved by using a shortcut function (a utility function, if you will) that allows simple syntax. I have made an attempt at that with InsertWikiEditorButton (maybe it will be integrated into the extension one day), example:
krInsertWikiEditorButton({
        "id": "mw-toolbar-editbutton",
        "icon": mw.config.get('wgExtensionAssetsPath') + '/ProofreadPage/button_category_plus.png',
        "label": mw.msg( 'proofreadpage_toggleheaders' ),
        "callback": pr_toggle_visibility
});
For more info on the available options you can pass, see the script documentation here or check the source code! –Krinkletalk 06:58, 20 June 2011 (UTC)
I am not doubting that the information on the page is exact and covers the necessary technical detail, it is just not helpful for an iggorant savage like myself. I tried the new callback coding without fortune, for me it breaks the script and defaults to the original toolbar look. To note, that I wasn't looking to complain, just frustrated that I was unable to do it. I feel like Silvester to Tweetybird. ;-)billinghurst sDrewth 12:13, 20 June 2011 (UTC)
Managed to get Helder's code to display the icon, now to see if I can get it to function. billinghurst sDrewth 12:18, 20 June 2011 (UTC)
Great! Just remember to add "()" after the name of the function you want to be executed, i.e. use "add_ocr();". Helder 13:04, 20 June 2011 (UTC)

[edit] Commons' DBR

Hello. I was wondering if commons:COM:DBR could include a report similar to w:Wikipedia:Database reports/User preferences. I think given that Commons is multilingual and a project with users from different projects the stats would be interesting to see. tyvm. Killiondude 02:29, 25 June 2011 (UTC)

Hi. commons:Commons:Database reports/User preferences. --MZMcBride 06:26, 25 June 2011 (UTC)
Thanks!!! As an aside, I wonder if ownwork is supposed to be (real) English... Killiondude 07:10, 25 June 2011 (UTC)

[edit] mw:Extension:Lilypond & Bugzilla:189

I am not sure whether there is any interest in addressing the outstanding components in the Bugzilla to get Lilypond extension functional for the Wikisource sub-domains. billinghurst sDrewth 14:18, 25 June 2011 (UTC)

I think it would be really nice if someone could improve the current implementation of the extension so that it could be usable on Wikimedia projects.
One of the current issues with the current implementation of the extension is sintetized on Bug 29630 (Make mw:Extension:LilyPond safe against DoS attacks). Helder 18:10, 28 June 2011 (UTC)
Ting just posted on wikitech-l about it (no reply yet). Nemo 15:25, 18 October 2011 (UTC)
The new "Score" extension is under active development to fulfill this need. Sumanah 02:57, 31 January 2012 (UTC)

[edit] Help with needed display option

Is there anyway to add the functionality produced by

self.proofreadpage_numbers_inline = true;

... so that it can be toggled on and off along with/in addition to 'hide page links' in the display option menu found in the sidebar of en.wikisource under dynamic layouts? TIA. -- George Orwell III 15:18, 28 June 2011 (UTC)

[edit] Special:ListFiles

Hi. I would like a link from Special:ListFiles to Special:Nuke that passes the person's username from the first to the latter. This is for use on Commons where we get a lot of contributors who only upload crap. If someone could help, that'd be great!

Example: commons:Special:ListFiles/Killiondude would have a link that leads me directly to commons:Special:Nuke/Killiondude. Killiondude 04:37, 17 August 2011 (UTC)

$ yes poke. Killiondude 23:54, 23 August 2011 (UTC)
Where do you want the link? I don't see a great spot for it. I guess it could go near the top of the page... or it could be a tab... or it could go in the sidebar. What's your preference?
I didn't realize that the "Nuke" extension already supports "Special:Nuke/<username>" syntax, so this should be fairly trivial to resolve, as it can be done purely and simply with jQuery. --MZMcBride 03:53, 24 August 2011 (UTC)
Ooh. A tab at the top would probably be nice. Because it's a special page there are no other tabs, so it would work nicely. And would whatever magic you employ be an opt-in js thing? Killiondude 05:20, 24 August 2011 (UTC)
I worked on this at testwiki:User:MZMcBride/killionboob.js. It kind of works currently, but only with Monobook. Something strange about Vector... I asked Krinkle about it. --MZMcBride 03:20, 25 August 2011 (UTC)
I only use Monobook. I tried it out on a case where I would have needed it and it worked indeed. Thanks!!!!! Killiondude 06:24, 25 August 2011 (UTC)
Works fine in Vector for me on testwiki. See here. What browser / os are you using and what is the url to the page where it's not showing up ? –Krinkletalk 11:49, 25 August 2011 (UTC)
I put the code at testwiki:User:MZMcBride/killionboob.js (imported into /monobook.js). I have a "*" tab in Monobook, but in Vector I only see protect/delete/move in the drop-down menu (using a URL like http://test.wikipedia.org/wiki/Easytimelinetest?useskin=vector). Chrome/OS X. --MZMcBride 19:34, 25 August 2011 (UTC)
Again, working fine for me. But ahm, guess what, the issue isn't in the killionboob.js script. monobook.js is only loaded in Monobook Face-surprise.svg. Do the same in vector.js (or use common.js instead) Face-smile.svg. –Krinkletalk 21:14, 25 August 2011 (UTC)
Yeah, I'm a moron. Thanks! :-) --MZMcBride 23:38, 25 August 2011 (UTC)

[edit] The mwbot log search is broken

The mwbot log search is broken. All searches return "You searched for an invalid regex, try again!" Emufarmers 15:29, 24 August 2011 (UTC)

Fixed. --MZMcBride 04:02, 25 August 2011 (UTC)
Thanks! Emufarmers 04:16, 25 August 2011 (UTC)

[edit] How can I make list numbering continue after inserting a table?

I am writing a test procedure so the steps are numbered. On several of the steps, I have inserted a table of several similar tests to be performed and a blank cell in each row for a check when it is done. When I try to continue my numbered list, there seems to be no way I can make the numbering automatically continue:

  1. Perform continuity checks on the following items to verify correct polarity:
    1. 24VDC supply
DC Supply Location Test Point Actuate Check Location Test Point Actuate Check Notes
24VDC Left SP K91:Vin+ Close F52 Right SP K91:Vin+ Close F52
24VDC Left SP A91:VIN Close F52 Right SP A91:VIN Close F52
24VDC Open all breakers, F52, F53, F54, F55


    1. 12VDC supply:

Has anyone found a trick to make this work? The preceding unsigned comment was added by 169.231.253.50 (talk • contribs) .

Use HTML. Wikimarkup is limited in this respect.

  1. Perform continuity checks on the following items to verify correct polarity:
    1. 24VDC supply
      DC Supply Location Test Point Actuate Check Location Test Point Actuate Check Notes
      24VDC Left SP K91:Vin+ Close F52 Right SP K91:Vin+ Close F52
      24VDC Left SP A91:VIN Close F52 Right SP A91:VIN Close F52
      24VDC Open all breakers, F52, F53, F54, F55
    2. 12VDC supply

Hope that helps. --MZMcBride 22:48, 9 September 2011 (UTC)

[edit] Wikipedia.org (all languages) Full-Text Search

Does anybody know what specific search engine(s) the wikipedia.org sites use to search the full text of article titles and content? There is a list of many possible search engines that can be used with the wikimedia platform on this MediaWiki page, but I don't see any discussion of what search tools are actually used on wikipedia.org (for various languages). It seems like they might be using MySQL fulltext indexes, but I don't believe those work for some foreign languages. I am working on a linguistic project that involves querying dumps of wikipedia databases from multiple languages, and I'm curious what kinds of search indexes are in use on the live sites.

Well, wikitech:Search is probably the best page that explains Wikimedia's search backend from a technical perspective currently. At one point I know that Wikimedia was using MyISAM instead of InnoDB for search servers, specifically because InnoDB doesn't support full-text searching, but I don't think Wikimedia uses MySQL searching at all at this point. There might be more useful information in the archives of wikitech-l. (Or you could post there with more specific questions.) Hope that helps. --MZMcBride 12:20, 10 September 2011 (UTC)

[edit] Commons gadget spawning error

Recorded at Commons:MediaWiki talk:Gadget-Cat-a-lot.js#Error message billinghurst sDrewth 11:56, 10 October 2011 (UTC)

Fixed by Krinkle. --MZMcBride 19:15, 16 October 2011 (UTC)

[edit] Feedback on toolserver move idea

Please see http://meta.wikimedia.org/wiki/Wikimedia_Forum#Move_of_toolserver.org_to_toolserver.wikimedia.org Petrb 15:13, 21 October 2011 (UTC)

[edit] Liverpool Collegiate School page - Len Horridge photographs fail to display on iPad

The three photographs below by Len Horridge which accompany the Wikipedia page Liverpool Collegiate School are no longer showing up on an iPad since being moved to Wikimedia Commons. They originally displayed fine and still display OK on iPhone and desktop machines, it's just the iPad where these three photos fail to show. I tried the page on two Pads, it doesn't seem to be a browser cache issue. The photos DO appear on the individual file pages, but the small images on the Liverpool Collegiate School article page are failing. Anyone tell me why?

Collegiate_after_cleaning_1973.jpg

Collegiate_hall_as_walled_garden.jpg

Collegiate_hall_firedamaged.jpg Keithbates51 09:11, 22 January 2012 (UTC)

Thanks for reporting this, the problem occurred because those images were deleted from the English Wikipedia as they were available on our sister project, Wikimedia Commons. Doing a hard refresh of the page to clear the server's cache (also known as a purge), by navigating to this link fixed the problem. To read more about purging, please see en:WP:PURGE. Hope this helps, The Helpful One 14:35, 22 January 2012 (UTC)

ManyThanks! Keithbates51 21:01, 22 January 2012 (UTC)

[edit] Question: NOINDEX

Does __NOINDEX__ work? -- Proofreader77 (talk) 20:14, 19 February 2012 (UTC)

Yes, it works on any page that's not defined as a content namespace. On Meta-Wiki, that means it'll work everywhere except in the main (unprefixed) namespace. Why do you ask? --MZMcBride (talk) 01:17, 20 February 2012 (UTC)
  • I vaguely remember a discussion about it not actually doing anything (at some point in the past in some context).
  • I see it doesn't cause a change to the rendered html page.
  • And it doesn't seem to add it to a robots.txt file.
I recently suggested adding it to a contentious RfC, and someone did that ... but just want to make sure that I hadn't suggested something that actually does nothing, as per above. :-) -- Proofreader77 (talk) 01:34, 20 February 2012 (UTC)
It does change the rendered HTML page. That's how it works. Look at the <meta> tags before and after. There will be an additional one if you use "NOINDEX" (norobots or something). Similarly there will be an extra meta tag if you use "INDEX". --MZMcBride (talk) 01:39, 20 February 2012 (UTC)
I am somehow overlooking it (in source) to this. (My html knowledge is a bit stale. Nothing jumps out, but may be in some included file ... Studying.) -- 01:55, 20 February 2012 (UTC)
That page is in the main (unprefixed) namespace. That namespace is defined as a content namespace, so "NOINDEX" won't work there. This is a security feature to prevent vandalism (e.g., someone removing w:Barack Obama from search engine indices). --MZMcBride (talk) 01:57, 20 February 2012 (UTC)
Thanks. (So yes it won't work there.) Note: When I suggested hiding from search, I was not suggesting __NOINDEX__ but rather something else that could be done; e.g., adding line to robots.txt. The person adding that code apparently thought that's what I meant. I wasn't sure that wouldn't work, so I didn't say anything ... but I (finally) realized I'd better check specifically, since it was done (apparently) due to my suggestion to hide from search. Thanks again. Proofreader77 (talk) 02:35, 20 February 2012 (UTC)
MediaWiki:Robots.txt controls each individual project's robots.txt file. The global version of robots.txt is printed above the robots.txt file on each project, e.g. <https://meta.wikimedia.org/robots.txt>. It doesn't really matter which de-indexing tool you use, once the content has gotten into search engines, it's very difficult to get out. robots.txt and "NOINDEX" work best when applied as the page is created. Otherwise, they're questionably useful. --MZMcBride (talk) 02:39, 20 February 2012 (UTC)
I solved that problem once upon a time in a specific case. (There's a trick to how you have to specify it to Google so it is accepted. yada yada yada) There may not be a solution for this case, of course. Again, thanks. Proofreader77 (talk) 02:50, 20 February 2012 (UTC)

[edit] Listen template on meta (403 error)

Is there a special reason the "Listen" template on meta doesn't produce a cute play button like on en.wikipedia (Can meta one be "upgraded" etc?) And why does the online player link give a 403 error about some expired user account? (I'd email them, but don't why I need to. :-) -- Proofreader77 (talk) 05:40, 27 February 2012 (UTC)

It was old and relied on an old tools.de hack that was now retired due to a closed account. I have copied over a version from English Wikisource. billinghurst sDrewth 09:42, 27 February 2012 (UTC)
Change of plan, too much other baggage would need to comwe over and this is generally not the place to store and display that media, I will see if I can just update the hack. billinghurst sDrewth 09:49, 27 February 2012 (UTC)
Whole thing seems problematic across namespace. Just putting an ogg file will get it to work fine, and if you want it formatted stick it in a table.
A Christmas Carol Stave 5 Dickens.ogg
A Christmas Carol stave 5.
Not sure what is wrong with the template that seems a tad temperamental, though not really worth throwing a lot of effort at it. billinghurst sDrewth 10:06, 27 February 2012 (UTC)
  • Thank you, billinghurst! Very much appreciate your time and careful attention to this. Certainly agree this is not a priority item, but I will perhaps back-burner ponder further the "problematic across namespace" issue. -- Proofreader77 (talk) 20:31, 27 February 2012 (UTC)

[edit] XML Datei nicht abwärtskompatibel?

Seit kurzem ist es nicht mehr möglich XML Dateien aus der deutschsprachigen Wikipedia in ältere MediaWiki Versionen (1.16.5) zu importieren. Woran liegt das und besteht die Möglichkeit da an der Import.php was zu ändern? Die Fehlermeldung lautet:

Warning: xml_parse() [function.xml-parse]: Unable to call handler in_() in /home/marjorie-wikiorg/public_html/literatur/w/includes/Import.php on line 437

Falls ich hier falsch bin, sag ich schonmal sorry. LG Lady Whistler Projekt Andere Wikis (Project Other Wikis) 11:36, 6 March 2012 (UTC)

[edit] Ombox

Ombox seems to be broken. Perhaps the new version of MediaWiki did this? Killiondude (talk) 04:54, 11 March 2012 (UTC)

I guess you didn't notice this thread. Too busy voting? --MZMcBride (talk) 05:53, 11 March 2012 (UTC)
I am aware of that unanswered thread. I thought this page might be a better place to bring it up. :) Killiondude (talk) 06:56, 11 March 2012 (UTC)

[edit] Can you time-link into .ogv files

Can you time-link into .ogv files (like in youtube you can append e.g., #t=1m20s to link to 1 minute and 20 seconds into a video)? -- Proofreader77 (talk) 20:10, 11 March 2012 (UTC)

Yes and no. bugzilla:26663 is related to this. There appears to be a working script that does this [1], but it was super slow for me on FF and didn't work on Chrome. Test it for yourself here. You could attempt to get community support for it to be included in the MediaWiki:Common.js file of whatever wiki you want to use it on. Or you could put it in your own .js file but the time link would only work for you and whoever else has it installed. I do have a sneaky suspicion that MZ will correct me if I'm wrong. :) Killiondude (talk) 04:35, 12 March 2012 (UTC)
Mdale did put a gadget at enWS (Add mwEmbed support for improved Video Playback.), though I cannot say that I have played with it, have a chat to s:en:User:Theornamentalist as they were the person play with it. If you have a file at Commons, then it can be hosted with a transcription at enWS. billinghurst sDrewth 04:56, 12 March 2012 (UTC)
Monthly Metrics Meeting March 1, 2012.ogv
  • Many (many!) thanks. Beautifully precise answer(s) — even if "the answer" is not as simple as one might wish (as many answers in the realm of multimedia/compatibility tend to be).

    Note that the specific video file that inspired my question is File:Monthly_Metrics_Meeting_March_1,_2012.ogv (1h 28m 30s), and was hoping there was an easy way to link to specific parts (if for no other purpose than to refresh my own memory on a key point or two.) And yes, I just crashed Chrome :-) ... will continue playing (and chatting in direction aimed). -- Proofreader77 (talk) 05:33, 12 March 2012 (UTC)

[edit] Query Limit from mobile or web Client

Hi, I am working on R&D for a new way to browse CC-licensed content on wikipedia.
Suppose there are 10.000 users with their mobile phones browsing the wiki in the same time, via API through the client we are developing (a mobile app).
I want to know how to design the app in order to guarantee people can browse it without delays or "dead queries".


We have a client (mobile/web) which contains the names of the objects to be populated with W content.

For example, to see the content of the movie "Blade Runner", I'd like to use exact query to display, say, the plot paragraph via wikipedia api.
Is there a limit of queries which can be done via api?
The same concept should be applied to the whole wiki, in this case I simply would like to call the whole article and restyle it.
Again, is a there a limit for this?
Finally, I'd like to share the profit with wikipedia foundation. Who should we contact for? Thank you! The preceding unsigned comment was added by ‎Gg4u (talk • contribs) .

Hi.
The English Wikipedia's API is available at <https://en.wikipedia.org/w/api.php>. All Wikimedia wikis have an API that can be easily utilized at their respective domains.
Regarding API limits, you're free to hit the API at a reasonable rate. Unfortunately I don't have an exact figure I can give you for requests/second or requests/minute. Just be reasonable.
Due to the architecture of Wikimedia's community (way more readers than editors), the HTML cache layer (in Squid) is much stronger than the API. If it's possible to use easily the rendered and stored HTML, I would. (It also comes with the benefit of being parsed for you.) But using the API is also fine if that's what your application needs.
The most important piece of writing a tool or script of this nature is to use a descriptive User-Agent, one that includes contact information for you in case you need to be reached regarding issues with your tool or script. Read the linked page for more information.
For donations, contact donate at wikimedia.org. That should get you routed to the appropriate Wikimedia staffer, though I'll ask someone else to double-check this.
Hope that helps. --MZMcBride (talk) 03:09, 15 March 2012 (UTC)
Yep, that's the right address. Thanks, MZ. Philippe (WMF) (talk) 03:19, 15 March 2012 (UTC)

Quick follow-up: there's been some mailing list discussion about this topic. Original thread; click through the "next message" links to read replies, particularly this one and this one. mw:API:Etiquette will also likely be useful to you. --MZMcBride (talk) 22:33, 15 March 2012 (UTC)

[edit] Global things

Hi! Didn't know where to ask so choosed to ask here. Watching in Recent changes page on other wikis I saw that reverters (I think that they are from "Small Wiki Monitoring Team") used en:Wikipedia:Twinkle (but normally on that wiki that isn't available). So is Twinkle (and maybe some other gadgets, for example HotCat) available for global use? --Edgars2007 (talk) 16:43, 26 March 2012 (UTC)

Hi. Global gadgets do not currently exist (bugzilla:20153).
What most people do to have a script in multiple places is keep a central repository (at Meta-Wiki or Commons or their home wiki or wherever) and then import that script into their /common.js or /skinname.js subpage on the projects where they work. For example, my central script repo is at User:MZMcBride/global.js and I import that script into other wikis such as commons:User:MZMcBride/monobook.js and wmf:User:MZMcBride/monobook.js. The benefit to using /common.js (as opposed to /skinname.js) is that /common.js will work with any skin, should you choose to change later. (Personally, I think I'll always use Monobook.) Hope that helps. --MZMcBride (talk) 03:06, 27 March 2012 (UTC)
Personal tools

Variants
Actions
Navigation
Community
Beyond the Web
Print/export
Toolbox