Wikipedia:Village pump (technical)/Archive 165

From Wikipedia, the free encyclopedia

regex

@@@ how to delete article between template and @@@ by regex thanksMonorodo (talk) 21:55, 4 April 2018 (UTC)

Hi @Monorodo:, you will need to be more detailed in what your challenge is. First, only administrators can delete pages. Please see the edit notice above ("Welcome to the village pump for technical issues.") and provide details about what is occurring. Thank you, — xaosflux Talk 22:04, 4 April 2018 (UTC)
{{Infobox football biography
| name = Adam Ståhl
| image = 
| fullname = Adam Mikael Sven Ståhl
| birth_date = {{birth date and age|1994|10|8}}
| birth_place = [[Malmö]], Sweden
| height = {{convert|1.86|m|abbr=on}}
| position = [[Midfielder]]
| currentclub = [[Kardemir Karabükspor]]
| clubnumber = 18
}}
any word
###

how to delete any word between template (Infobox football biography) and ### by regex code thanks Monorodo (talk) 23:24, 4 April 2018 (UTC)

Is "###" a literal string, or it represents any characters following any word ? -- GreenC 04:15, 5 April 2018 (UTC)

regex needed

hi I need :

  • We have the full XML of a Wikipedia article
  • We need just the Infobox and navbox and <title>New France</title>
<page>
    <title>New France</title>
    <ns>0</ns>
    <id>159828</id>
    <revision>
      <id>822862933</id>
{{Infobox former country
|native_name            = ''Nouvelle-France''
|conventional_long_name = New France
|common_name            = New France
}}
'''New France''' ({{langx|fr|Nouvelle-France}}) was the area [[French colonization of the Americas|colonized]] by [[France]] 
{{Navboxes
|title=Articles related to New France
|list1=
{{Canadian colonies}}
{{Canadian history}}
{{Former French colonies}}
{{European Colonization of North America}}
}}
{{DEFAULTSORT:New France}}
[[Category:Colonial United States (French)| ]]

I am use this regex (?=\{Infobox former conuntry)(\{([^{}]|(?1))*\})

this regex select only infobox. now I want select all except navbox and infobox? what is the best regex ? thanksMonorodo (talk) 10:21, 7 April 2018 (UTC)

@Monorodo: If you use a regex, your matching is likely to fail if the order of the parameters changes, or if there is a template inside one of the parameters, etc. The best way to do this is to use an XML parser to get the wikitext of the whole page, and then to use a wikitext parser to get the information from the wikitext. If you're using Python, you can use xml.etree.ElementTree and MWParserFromHell. Best — Mr. Stradivarius  talk  01:24, 8 April 2018 (UTC)

regex for wikitable in xml file

{| class="wikitable"
|-
!colspan=9|[[Football at the Islamic Solidarity Games|Football at the Islamic Solidarity Games record]]
|-
|-
!Year
!Round
!Position
!{{Tooltip|Pld|Games played}}
!{{Tooltip|W|Won}}
!{{Tooltip|D|Drawn}}
!{{Tooltip|L|Lost}}
!{{Tooltip|GF|Goals for}}
!{{Tooltip|GA|Goals against}}
|-
|{{flagicon|Saudi Arabia}} [[Football at the 2005 Islamic Solidarity Games|2005]]||[[File:Silver medal icon.svg|16px]] ''Silver Medal''||2nd||5||2||2||1||4||2
|-
|{{flagicon|Iran}} [[2010 Islamic Solidarity Games|2010]]||colspan=8|''Cancelled''
|-
|{{flagicon|Indonesia}} [[Football at the 2013 Islamic Solidarity Games|2013]]||[[File:Gold medal icon.svg|16px]] '''Gold Medal'''||1st||4||3||0||1||6||3
|-
|{{flagicon|Azerbaijan}} [[Football at the 2017 Islamic Solidarity Games|2017]]||Group Stage||5th||3||1||2||0||2||1
|-
|{{flagicon|Turkey}} [[2021 Islamic Solidarity Games|2021]]||colspan=8|To Be Determined
|-
!Total||1 Title||3/3||12||6||4||2||12||6
|}

what is the regex to extract wikitable in xml file. thanksMonorodo (talk) 20:26, 10 April 2018 (UTC)

Isn't this a supplementary to your earlier thread Wikipedia:Village pump (technical)#regex needed? --Redrose64 🌹 (talk) 22:45, 10 April 2018 (UTC)

Hi Mr:User:Redrose64.yes

I cant work with python. I need only regex. thanks.Monorodo (talk) 23:38, 10 April 2018 (UTC)

If you can make some assumptions about the input, this can be greatly simplified. regex in itself only matches a pattern, perhaps putting the pieces into variables that can be used later. Do you want to code this in javascript, perhaps using the "replace" function? Then you can run it from your browser on request. I myself have coded this sort of thing by first clearing all variable values when encountering the xml code for the start of an object that is a row in your table, then when matching the codes signalling the start of field values, match everything to the end and putting that into a variable, then at the end xml tag for the structure print out your info in the table format. consider the /m for multiline, or /g for global repeated action on the string. Graeme Bartlett (talk) 00:39, 11 April 2018 (UTC)

@Monorodo: It guess it'll be a lot easier to help you, if you tell use, what exactly you are trying to archive. So:

  • What exactly do you need? Wikitext? HTML? Or just the content?
  • And what for? Another wiki(-article)? HTML? Word? A Database?

Since parsing nested templates in WikiText is a pain, probably the easiest way is not to use the Wikitext at all but it's HTML-representation. Thanks to the Document Object Model it is quite easy to access specific nodes (and there content) via JavaScript (or any other HTML-capable programming language). E.g. the following JS gives you all the tables in the Morocco_national_football_team-Artikel:

$('table.wikitable').each(function(){
  console.log( this.outerHTML );
});

// Martin Kraft (talk) 08:53, 13 April 2018 (UTC)

replace by regex

== See also ==
* [[Wallachia]]
== Gallery ==
<gallery>
File:Curtea de Arges.E.jpg|St. Nicholas Princely Church
File:Catedrala Curtea de Arges.jpg|Curtea de Argeș Cathedral in an 1880 engraving
</gallery>

Hello. How to move galley section above see also section by regex (pcre php). thanksMonorodo (talk) 23:21, 13 April 2018 (UTC)

502 error for a tools.wmflabs.org service

Is tools.wmflabs.org down? I get " Bad Gateway. nginx/1.13.6". Nurg (talk) 01:50, 14 April 2018 (UTC)

This is a link I'm trying - https://tools.wmflabs.org/enwp10/cgi-bin/list2.fcgi?run=yes&projecta=Solar_System&importance=Top-Class. Nurg (talk) 01:55, 14 April 2018 (UTC)
Not affecting all services at tools.wmflabs.org. I have now opened https://phabricator.wikimedia.org/T192192. Nurg (talk) 02:05, 14 April 2018 (UTC)

Bold and italic buttons in edit toolbar obscuring edit window text (Monobook, IE11)

On Monobook (IE11) the bold and italic buttons in the edit toolbar have suddenly started showing up for me as oversized squares that obscure the beginning of the top line of the text in the edit window. On Vector I still see the odd squares around the B and the I, but they don't protrude into the edit window. Is this happening for anyone else? Double sharp (talk) 14:19, 13 April 2018 (UTC)

It works for me. Does it happen if you log out and edit with MonoBook? What about safemode? Try to clear your cache. Do you see the single letters B and I or boxes spelling out "Bold" and "Italics"? I get rectangular hover boxes with the full words when I hover over the buttons but they don't obscure the edit area. PrimeHunter (talk) 15:51, 13 April 2018 (UTC)
It doesn't happen if I log out and edit with MonoBook, or in safemode. I see the single letters B and I. Double sharp (talk) 06:52, 14 April 2018 (UTC)
This code in User:Double sharp/common.css changes your buttons:
.oo-ui-buttonElement-button {
border: 1px solid black !important; 
background-image: linear-gradient(to bottom,#eee,#eee 100%) !important;
border-radius: 0 !important;
padding: 0.5rem !important;
transition: none !important;
}
MediaWiki tweaks may sometimes change the result. If you don't want to remove all of it then you can experiment by previewing User:Double sharp/common.css with variations of it. If you are in a special editor for CSS pages then click the <> icon at the top left to change to the normal editor so you can see the effect during normal editing. PrimeHunter (talk) 10:36, 14 April 2018 (UTC)
@PrimeHunter: Thanks for elucidating the problem! I've removed this code and it's now working properly. I originally added it after a suggestion by SoWhy from Wikipedia:Village_pump_(technical)/Archive_159#Save_changes_buttons_-_accessibility in July 2017, but it seems like Mikhail Ryazanov's solution works by itself already. Double sharp (talk) 12:26, 14 April 2018 (UTC)

Scripts assist

I have enabled some scripts in my custom js and vector js and cleared all cache but some features and functions that was visible at first seem to have disappeared please help what's is the problem and can you fix it please User:DashDog01/common.js User:DashDog01/vector.js  Preceding unsigned comment added by DashDog01 (talkcontribs) 01:27, 14 April 2018 (UTC)

Why you people didnt answer my question on scripts assistDashDog01 (talk) 08:33, 14 April 2018 (UTC)
Because most of us are volunteers (so we have no obligations), and many of us were sleeping during the few hours since you asked your question. --Pipetricker (talk) 12:29, 14 April 2018 (UTC)
Line 10 in the first example was missing a close bracket, and line 10 and 11 were missing semicolons. Line 12 in vector.js had an extra bracket. I've removed/added them, but I can't test it to see if it worked - you'll need to confirm if they were the issues. - Bilby (talk) 08:40, 14 April 2018 (UTC)
just wanted you to know problems fixed thanks for your help 👍  Preceding unsigned comment added by DashDog01 (talkcontribs) 14:51, 14 April 2018 (UTC)

don't invite people to post messages into archives

If you try to access an archive that doesn't exist, like if I have two talk archive pages and you try to access Archive_3, which would normally be redlinked, Wikipedia says, "Post a message to Nick Levinson/Archive 3." It also says, "No messages have been posted for this user yet." Of course, they have been posted, but to the current talk page, not into the redlinked archive. I'm not sure if any users have nonexistent archives on their watchlists and would ever find out if any message were posted into a nonexistent archive, at least until the recipient tried to create a new archive, perhaps months or years later. (Per instructions, I submitted this to MediaWiki Phabricator, but I was referred back to here, so perhaps the VP(T) instructions should be edited, but that would be a separate issue.) Nick Levinson (talk) 00:26, 8 April 2018 (UTC)

Hi @Nick Levinson:, this is controlled through our template: Template:No article text, you can discuss improvements on its talk page (perhaps some conditional checking if something is a user talk subpage). — xaosflux Talk 00:54, 8 April 2018 (UTC)
Thank you. I opened a discussion at the template talk page. Nick Levinson (talk) 21:01, 14 April 2018 (UTC)

Crazy spike in viewing figures

Hi, any explanation for this?

https://tools.wmflabs.org/pageviews/?project=en.wikipedia.org&platform=all-access&agent=user&range=latest-90&pages=Golden_Earring_discography  Preceding unsigned comment added by 86.191.155.106 (talk) 00:15, 11 April 2018 (UTC)

It was only on browsers identifying as "desktop", and not spiking on mobile. So likely the result of one computer gone crazy reloading, accidentally or deliberately. Maybe some person testing some code let it get out of control in a loop. Or perhaps something slipped on a keyboard,"r" and "ctrl" keys. Graeme Bartlett (talk) 00:47, 11 April 2018 (UTC)
OK, thanks for the suggestions. 86.191.155.106 (talk) 23:25, 14 April 2018 (UTC)

Template:Graph:Chart displays x-axis values in incorrect order

At User:Master of Time/sandbox#Earthquakes in Oklahoma, the x-axis values are displaying in the incorrect order; presumably because the first value is not an actual number, the template for whatever reason puts it at the end instead. Is there any workaround for this issue? Master of Time (talk) 23:25, 14 April 2018 (UTC)

Just to add to what I said earlier, even when I change the x value "'78–'99" to "1978–1999", the issue remains. The bar appears in the correct spot if I simply say "1978" or "1999", but that's not what I want it to say. Master of Time (talk) 23:32, 14 April 2018 (UTC)

Looking at the documentation at {{Graph:Chart}} and mw:Extension:Graph I can't see any notes on how the x values work. One of the demos starts with an example of a simple bar chart. Changing the first x value from 1 to 9 makes the item for 9 appear after the others. That is, the graph extension sorts the (x,y) pairs by the x value, putting strings after numbers. Yurik could explain what is going on. Johnuniq (talk) 00:54, 15 April 2018 (UTC)
Well, since you mentioned it, @Yurik: could you explain? Master of Time (talk) 06:15, 15 April 2018 (UTC)

Template:Connected contributor

Why is it showing people's names twice? See Talk:Jason Scott and Talk:William Connolley for what I'm talking about. The Blade of the Northern Lights (話して下さい) 00:38, 16 April 2018 (UTC)

The instances of the template used on those two talk pages were using the unsupported parameter |2= (a second unnamed parameter). I have created Category:Pages using connected contributor with unknown parameters to track such usages, that should be corrected to match the template's documentation. I have fixed one of them. – Jonesey95 (talk) 00:51, 16 April 2018 (UTC)
Thanks, and thank you also for fixing my autocorrrct misfire in the header (usually this works the other way around with capitalization, of course it'd go this way now!). The Blade of the Northern Lights (話して下さい) 01:02, 16 April 2018 (UTC)

Unable to delete anything

The "delete" functionality seems to have stopped working. I've tried it on a few speedies (example) and get:

"A database query error has occurred. This may indicate a bug in the software.

[Wsx7PgpAAEQAAEII7OoAAACE] 2018-04-10 08:53:14: Fatal exception of type "Wikimedia\Rdbms\DBQueryTimeoutError"

The deletion log appears to have had no activity for 15 minutes, which suggests other admins are having problems too. Ritchie333 (talk) (cont) 08:55, 10 April 2018 (UTC)

Same here. Will file at Phab. BethNaught (talk) 08:57, 10 April 2018 (UTC)
  • I just came over here to report the same thing myself - several deletions I just attempted gave the same error "A database query error has occurred. This may indicate a bug in the software." and "[Wsx78gpAMF0AAEo1QGwAAABE] 2018-04-10 08:56:15: Fatal exception of type "Wikimedia\Rdbms\DBQueryTimeoutError"" (with the "Wsx78gpAMF0AAEo1QGwAAABE" part different in each case). Boing! said Zebedee (talk) 08:58, 10 April 2018 (UTC)
(edit conflict) Was in the process of writing out the exact same message. I've tried deleting different namespaces and with different reasons but to no avail. I'm getting the exact same error message (except the string at the start which is different every time). Anarchyte (work | talk) 09:00, 10 April 2018 (UTC)
  • Huh:) The spammers ought to have a (predictably short) fun-time.....~ Winged BladesGodric 09:16, 10 April 2018 (UTC)

It's been fixed. Anarchyte (work | talk) 09:26, 10 April 2018 (UTC)

Can confirm - this is fixed now :-) ~Oshwah~(talk) (contribs) 09:29, 10 April 2018 (UTC)
Yup - on one G12 I just looked at, somebody had done a courtesy blanking in the interim to get rid of the copyvio. Ritchie333 (talk) (cont) 09:30, 10 April 2018 (UTC)
Yep, all good here too. Boing! said Zebedee (talk) 09:31, 10 April 2018 (UTC)
It seems some regular database maintenance, that should normally have no impact on edits made deletes fail for 40 minutes. Database administrators will research why this happened and put measures in place to prevent from happening again. Apologies for the problems caused, this was a really bad thing to happen. We will share our findings here, for the time being, you may want to review edits from 9:40 to 10:19 UTCCorrection: 8:40 to 9:19 UTC in case some to-delete pages/editions were missed. --JCrespo (WMF) (talk) 09:36, 10 April 2018 (UTC)
Techie things go wrong, that's just life ;-) Thanks for the quick response. Boing! said Zebedee (talk) 09:37, 10 April 2018 (UTC)
I once discovered the hard way that if you start an OPTIMIZE TABLE on a mysql database, and then kill it with CTRL+C, it leaves the table in an unusable state. As Boing! said, things break, it's just life, and thanks for the prompt investigation. Ritchie333 (talk) (cont) 09:53, 10 April 2018 (UTC)
A preliminary incident report has been published at https://wikitech.wikimedia.org/wiki/Incident_documentation/20180410-Deleting_a_page_on_enwiki Sadly it is not as easy as "a wrong command was sent". The initial research points to a race condition on blocking on delete + blocking on maintenance, but only once we reduce the amount of locking done on delete (T191892) we will see if that prevents the issue in the future (other than monitor an correct earlier the issue). --JCrespo (WMF) (talk) 15:32, 10 April 2018 (UTC)
In a decades-long career as a user of large computer systems in industry, I always found it hard to distinguish between successful hacking and failed maintenance, when maintainers don’t manage to test the effects of their changes, or to note problems and notify users appropriately that the problem has been detected and is being fixed. Edison (talk) 14:30, 16 April 2018 (UTC)

Non-free images in portal

A number of non-free images have been somehow embedded or transcluded into Portal:Amiga which is a problem per WP:NFCC#9. Does anyone know how to tweak the portal's syntax so that it does not include any non-free content? The files are File:HAM6example.png, File:Amiga-90sLogo.gif, File:Amiga Logo 1985.svg and File:Recent Amiga.svg. -- Marchjuly (talk) 07:59, 16 April 2018 (UTC)

  • Reminds me of another problem with portals, that often people copy from articles without attribution. Anyhow, I've fixed it by reverting Legacypac's edit here. Also legacypac, atleast use {{#lsth:Article}} to transclude only the lead - the entire article shouldn't be dumped in the front of a portal lead Galobtter (pingó mió) 08:18, 16 April 2018 (UTC)
Was not aware of that bit of code. I did not like the content as it was presented. I'd rather redirect the entire portal to the associated topic Legacypac (talk) 15:11, 16 April 2018 (UTC)

Tech News: 2018-16

15:20, 16 April 2018 (UTC)

Two factor authentication for all users?

Seeing that account security is a big issue nowadays I was wondering about 2FA for Wikipedia - using either hardware keys or authenticator apps. I was surprised to learn that it is to a subset of users (mostly admin type people). Is there any reason it cannot be offered to regular users?  Preceding unsigned comment added by Master Of Ninja (talkcontribs) 16:19, 12 April 2018 (UTC)

This is proposed quite frequently, but there are scalability issues that prevent it from being rolled out more fully. You may wish to see the discussion from last month about enabling two-factor authentication for more information. --Deskana (talk) 16:35, 12 April 2018 (UTC)
Thank you for the explanation and link. - Master Of Ninja (talk) 17:36, 12 April 2018 (UTC)
The main issue that I see is that the current implementation has no backup. With most 2FA systems, there are other ways to get in to your account if you lose your authenticator software or the seed code (Google has a system that can call you with a login code, banks have customer service people who can ask you security questions or, if worst comes to worst, snail mail you to verify your identity, etc.). Unfortunately, most of those methods wouldn't work for Wikipedia since it would require the WMF storing your personal information, which they don't want to do (Wikipedia could use email as a second factor, but there are security issues with email). Instead, you have to open a bug report on Phabricator, wait for a developer to see it, hope that your IP hasn't changed so a checkuser can verify your ID, and then the developer has to manually edit the database to remove 2FA from your account--Ahecht (TALK
PAGE
) 22:57, 12 April 2018 (UTC)
It's not actually manually editing the database, it's running a maintenance script, but otherwise mostly correct. FACE WITH TEARS OF JOY [u+1F602] 04:00, 17 April 2018 (UTC)

Left-aligned Module:Photo montage

About Module:Photo montage, in using mobile view, all of the montage photos are left-align. For example, Desktop view, Mobile view. Could you change it to align-center? I think it looks nicer than now. How do you think?--126.236.202.216 (talk) 13:41, 13 April 2018 (UTC)

That page doesn't use that module. Also, please always report your exact browser version and your OS version. —TheDJ (talkcontribs) 18:40, 13 April 2018 (UTC)
The page had already been edited from Module:Photo montage to Module:Multiple image. See the former version, this problem is caused by Module:Photo montage. OS/iOS 11.3, brouser/Safari (sorry, version unknown)--126.236.202.216 (talk) 04:39, 14 April 2018 (UTC)
When this was reported, the then version of the article, which used Module:Photo montage, had the montage left-aligned for me when viewed in mobile view in Google Chrome on Mac OS X. Appears Frietjes' change of the module from table to div since then fixed that. --Pipetricker (talk) 21:46, 16 April 2018 (UTC)
 Done Thanks.—126.236.196.246 (talk) 04:28, 17 April 2018 (UTC)

Responsive MonoBook

General question: does anyone know of any particular reasons why making the MonoBook skin responsive for mobile (sidebar moved to bottom, navigation in general a bit collapsed, has proper scaling, looks like this, screenshots: phab:F16577440, phab:F16577439) would be a bad idea? As much as I'd argue that all skins should just work across devices and scale appropriately, it's come up that some people may not want this. Do folks here expect such to be the case, or something that should be considered a blocker? -— Isarra 19:02, 14 April 2018 (UTC)

You want to begin another project? Ruslik_Zero 20:50, 14 April 2018 (UTC)
XD --Izno (talk) 20:52, 14 April 2018 (UTC)
More accurate would be to say I already... did it, really, though it's a fairly small one. The patch exists and just needs some fixes before we merge it, but it also makes sense to verify that it's not likely to be a problem in practice beforehand as well. -— Isarra 21:45, 14 April 2018 (UTC)
I use Timeless presently and if I didn't have at least one sidebar for any medium-size or longer article I would be sad. --Izno (talk) 20:52, 14 April 2018 (UTC)
It'd still have the sidebar at normal resolutions, as the desktop layout is unchanged. The linked example has it live on my personal wiki, so if you make it narrow you can see it collapses into the mobile layout at 850px. -— Isarra 21:45, 14 April 2018 (UTC)
Right, but some people either a) edit on mobile or b) edit with a half-width screen. Actually, this is something about Timeless that bothers me come to think of it. :) --Izno (talk) 22:11, 14 April 2018 (UTC)
(And it bothers me more because I only have access to the tools in one place--the top... maybe I don't need them? --Izno (talk) 22:14, 14 April 2018 (UTC))
We should speak more about this, because it sounds like you might be hitting on something that could well be quite important in general for this stuff. What's the issue, exactly, that's been coming up? That it's just too wide that the layout changes? Is it causing problems specifically for the editing action, or just usage in general as an editor? -— Isarra 12:44, 17 April 2018 (UTC)
Really the idea here is to make ALL the skins work across devices. Timeless, MonoBook, Vector... -— Isarra 21:46, 14 April 2018 (UTC)
Sure. --Izno (talk) 22:11, 14 April 2018 (UTC)
I still see the sidebar at the left side, not at the bottom. Ruslik_Zero 20:28, 15 April 2018 (UTC)
It's only at small resolutions it does that. Under 850px at standard dpi. Otherwise it's exactly the same. -— Isarra 12:44, 17 April 2018 (UTC)

Why did I get a notification about this?

I got a notification that looked like this.

I'm rather baffled, since the linked diff appears to make no mention of me whatsoever. Can anyone explain why I received this notification? Eman235/talk 05:21, 14 April 2018 (UTC)

You probably got pinged because Atsme's user page got transcluded by accident. Probably because of the image with this caption: ""In Memorandum: An Editor's Hand after Scrolling down EEng's Talk Page." User:Eman235/talk 5:40 am, 29 May 2017 (UTC−5)". Anarchyte (work | talk) 06:30, 14 April 2018 (UTC)
@Eman235: Yes, Mr. Daniel Plainview (talk · contribs) wrote {{user:Atsme|Atsme}} presumably as a typo for either {{user|Atsme|Atsme}} or [[user:Atsme|Atsme]]. The first is only one character different, the second four; but whichever it was intended, it makes all the world of difference. So, everybody whose user page is linked from user:Atsme will have been notified for the same edit. --Redrose64 🌹 (talk) 09:11, 14 April 2018 (UTC)
Oh my!! Apologies to all... Atsme📞📧 09:36, 14 April 2018 (UTC)
Haha! That's an amazing mistake... Eman235/talk 02:11, 15 April 2018 (UTC)
LOL well that's a smidgen embarrassing. Sorry about the confusion. Still kind of trying to work out the best way to ping other users without the colon added by default. Mr. Daniel Plainview (talk) 15:08, 16 April 2018 (UTC)
Mr. Daniel Plainview You can use a simple link, as here; or a variety of templates, the simplest of which is {{u}}. --Redrose64 🌹 (talk) 20:53, 16 April 2018 (UTC)
I use {{yo|Example}} for pinging, it's easy enough. Home Lander (talk) 21:26, 16 April 2018 (UTC)
@Home Lander: {{yo}} is merely a redirect to {{reply to}} and as such it includes a colon, which is what Mr. Daniel Plainview doesn't want. --Redrose64 🌹 (talk) 13:54, 17 April 2018 (UTC)
It's pretty janky, but I did write a user script to help with this; it puts a drop-down below the edit box that gives you an option to insert a ping for you for anyone whose name is already linked in the section. Installation is to add mw.loader.load("/w/index.php?title=User:Writ Keeper/Scripts/autoping.js‎&action=raw&ctype=text/javascript"); to your common.js page. Like I said, it's a little janky, though; the user detection isn't perfect, and it doesn't always insert the ping in the right place. Still might be of use though. Writ Keeper  14:07, 17 April 2018 (UTC)
@Writ Keeper: I'm having trouble understanding how it works... presumably it scans for usernames and encloses these in [[User:username|username]]. It's something to do with a variable called this but I can't find where that is set, nor even declared (I guess it's a string?); the first use is as this.selectedIndex but even that isn't set up anywhere. --Redrose64 🌹 (talk) 18:09, 17 April 2018 (UTC)
@Redrose64: Not quite. What it does is it scans for usernames that are already linked in the section (as identified by the regex /\[\[User:([^|#\/\]]+)/g), which will usually be either people's pings or signatures. It then puts those names in a dropdown menu right above the edit summary box; when one of the usernames in the dropdown is chosen, the script will insert a ping, in the form @[[User:<username>|<username>]]: into the edit box at the cursor's last location. (If the cursor hasn't been in the editbox yet, or if the edit box has lost focus, the placement can still get pretty wonky.) The this that you see is the dropdown menu itself, such that this.selectedIndex is a reference to the dropdown entry chosen (i.e. the index that was selected). It's a Java-style this keyword; it refers to the object currently being operated on. In this context, it refers to the DOM object from the jQuery selector $("#pingMenu"), since the code is in that object's "change" event callback. (I spend a loooot of time in the jQuery API.) Writ Keeper  18:49, 17 April 2018 (UTC)
Writ Keeper: In which case, I don't see the point. Notifications are generated by links to a user page, as here. Changing such links to templates will make no difference at all as to whether a notification is sent or not. --Redrose64 🌹 (talk) 19:29, 17 April 2018 (UTC)
@Redrose64: I...think you still might not get how it works? The point is that you don't have to type out a user wiki link or remember a template format or (especially) copy and paste a user who has wacky characters in their name, you just click on a dropdown and the script writes it out for you. It doesn't change anything to anything else, it inserts something. Like, if I was too lazy to type out Redrose64, but wanted to ping you, I just choose the dropdown and the script writes out: @[[User:Redrose64|Redrose64]]: Writ Keeper  20:01, 17 April 2018 (UTC)
This did not notify me. It is fairly well known that the user link and signature must be added in the same post, but it is less well understood that it must all be done be a new post, not as an amendment to an existing post. That is also one of the reasons that I am sceptical about your script. If you link a few examples of where your script has been used, I should be able to determine if a notification would have been sent. --Redrose64 🌹 (talk) 20:43, 17 April 2018 (UTC)
@Redrose64: I mean, that has nothing to do with my script. This is an edit where I used the script, and the ping went through. This very post is another. Writ Keeper  20:48, 17 April 2018 (UTC)

@Redrose64: Ha, when he wrote about not wanting a colon, I interpreted that as not having to type one, like he did above for the accidental userpage transclusion. LOL. Home Lander (talk) 13:57, 17 April 2018 (UTC)

Delete

Plz delete Module:Compare User:Capankajsmilyo(Talk | Infobox assistance) 12:08, 18 April 2018 (UTC)

 Done
For future tests like that consider using the module sandbox Module:Sandbox
Trappist the monk (talk) 12:13, 18 April 2018 (UTC)

Petscan down

https://petscan.wmflabs.org has been giving a "502 Bad Gateway error" for about the last 40 minutes. William Avery (talk) 20:29, 17 April 2018 (UTC)

It's still giving the same error. What's the best talk place to find out info about this? - X201 (talk) 07:59, 18 April 2018 (UTC)
Still down. Petscan is an invaluable maintenance tool: what is the best way to contact the WMF engineering team about this? -- The Anome (talk) 09:52, 18 April 2018 (UTC)
It's back now. It would still be useful to know where to report problems in future; and interesting to know why it went down for so long. William Avery (talk) 11:49, 18 April 2018 (UTC)
Well some searching often gives you the answer. In this case Wikipedia:PetScan comes up quite quickly, which gives you all the information you need. —TheDJ (talkcontribs)
@TheDJ: - I've got to disagree with you there. While there is reference that this is run by "Wikimedia Foundation's cloud computing environment", the "issues" link goes to the third party bitbucket.org reporting service. That page also says it is an "external tool", and yes it is not part of core, but if it is operated by WMF it is in the enterprise scope. So from just reading the page you referenced, this appears that there is some paid support from the foundation that perhaps should be engaged via phabricator - but like with what I think are too many services, there is no clear direction on how users should intake trouble reports and what to expect once it is submitted; or if after-action reports are going to be produced. This type of confusion is unfortunately common with tooling, especially knowing what aspects of outages are expected to be handled under an SLO by paid staff and which aspects are dependent on volunteers. — xaosflux Talk 14:58, 18 April 2018 (UTC)
Note, I'm really just trying to think of a way forward on issue reporting - perhaps we need some big templates (report an issue) that can be applied to the most popular tools - and they can link to or include specific directions for the bigger apps. — xaosflux Talk 15:04, 18 April 2018 (UTC)
Yeah, i guess a lot of people have trouble distinguish between "run on" and "run by" —TheDJ (talkcontribs) 15:26, 18 April 2018 (UTC)
And most people would have no way to know if something isn't working because an underlying system is malfunctioning. — xaosflux Talk 15:56, 18 April 2018 (UTC)
I found and followed the issues link, but it seemed to be for dev issues, rather than operational problems. William Avery (talk) 18:39, 18 April 2018 (UTC)

Replication lag

The on going replication lag on ToolForge is apparently due to normalization of users and IP addresses in the database. The "analytics" database server replag varies (due to the round-robin DNS?). The "web" server has no secondary, so lag is consistent.

@JCrespo (WMF):, would you like to add anything? — Dispenser 01:58, 19 April 2018 (UTC)

Replication lag should now be fixed on 2 out of 3 servers. We try to keep the web server as updated as possible, but the analytics ones, due to long running queries, sometimes it is simply not possible. If queries are short, you can use the web server. Due to the current topology and the nature of the changes (ROW based replication is more reliable, but also less flexible with schema changes), sometimes replication lag has to happen. The smaller tables that will be introduced will minimize in the future the schema change time. Also, there is ongoing plans to make redundant, not only the servers, as there is now, but the replication channel T190704, that should also minimize (but not make fully disappear) lagging due to maintenance- we are only waiting on new hardware to arrive for it. --JCrespo (WMF) (talk) 07:52, 19 April 2018 (UTC)

Invisible stub category?

For several days the redirect Romani people in Slovenia has been appearing in the list at Category:Stubs. There is no visible stub template or category in the redirect "article", nor anything in the history of the redirect which seems to show either of these. Articles from which the {{stub}} template (or the incorrect Category:Stubs) is removed (usually replaced by a specific stub template) normally disappear from the category listing instantly. Any ideas? I'd just like to stop it appearing when I'm stub-sorting. PamD 07:48, 19 April 2018 (UTC)

It's not there now. That may be because the article was, coincidentally, just edited and that would have purged cached information. Some background is at WP:PURGE but an easy way to purge would be to edit the article then click Publish without making any change and with no edit summary. Nothing will be recorded in the edit history but categories will be updated. Johnuniq (talk) 08:18, 19 April 2018 (UTC)
Thanks: will try to remember that for another time. PamD 11:37, 19 April 2018 (UTC)
A purge updates the page itself but not category pages and WhatLinksHere. A null edit updates all of it. Johnuniq described a null edit but called it a purge. PrimeHunter (talk)

Can someone link to the (formal) definition of the wikilink RGB colors (for example, the blue of the in blue wikilink)? I want to do contrast checks. - DePiep (talk) 09:58, 19 April 2018 (UTC)

See Help:Link_color. BlackcurrantTea (talk) 10:18, 19 April 2018 (UTC)
Resolved
- DePiep (talk) 12:31, 19 April 2018 (UTC)

Table isn't working

The Fb cl header navbar template that I use on many of the pages I've created has stopped working, in spite of the fact that it has not yet been deleted. Why is this happening? Also, if it is deleted, what would be the easiest way to replace my tables? Birdsgeek (talk)

Examples:

@Birdsgeek: I moved the <noinclude> code to in front of the TfD tag and purged the cache on one of the articles on which it is used, and it seems to have made a difference. Is it behaving normally now? Home Lander (talk) 15:18, 19 April 2018 (UTC)
Yes, it is. Thank you! Birdsgeek (talkcontribs) 17:35, 19 April 2018

Username should be c/p-able

Hi. About WP:USERNAME. Whatever their fancy colors styling duh, I run into this problem: I cannot copy/paste their username. So I propose: Username must be c/p friendly (css wise). - DePiep (talk) —Preceding undated comment added 20:15, 15 April 2018 (UTC)

What are you referring to? "fancy colors styling" sounds like your issue is with customized signatures and not with the username policy. If you think a signature should display the real username so you can copy-paste from the rendered signature instead of the mandatory wikilink in the source then you can post a suggestion to Wikipedia talk:Signatures. If you see a signature without the username in the source then point the user to WP:SIGLINK. If you enable "Navigation popups" at Special:Preferences#mw-prefsection-gadgets then you can copy-paste the username from a popup when you hover over a signature. PrimeHunter (talk) 21:51, 15 April 2018 (UTC)
I say: Similar to {{DISPLAYTITLE:}}: the username in a sign must be copy/paste-able whatever the formatting (styling). Sure that could require a guideline change. - DePiep (talk) 20:44, 17 April 2018 (UTC)
Or WP:DISPLAYTITLE. Any phab id? - DePiep (talk) 21:04, 17 April 2018 (UTC)
I doubt there would be a phab id; it's not a technical problem, and I don't think there could be a technical solution, short of removing the ability to customize signatures. In what context do you need to copy and paste a user's name?Writ Keeper  21:12, 17 April 2018 (UTC)
hmm, in communication (think talkpage). It helps when the reply-to name is the same as the post-sign-name (duh). For *all* readers of a discussion. Today, one cannot trust searching a sign-name (because the user-name may be different & hidden). - DePiep (talk) 21:19, 17 April 2018 (UTC)
@DePiep: Please clarify. Is your complaint (1) that some rendered signatures do not show the username, or (2) that the usernames in some rendered signatures are not c/p-able? Mandruss  21:55, 17 April 2018 (UTC)
All of these, and more: they should be legible too. - DePiep (talk) 22:26, 17 April 2018 (UTC)
  • Examples of bad:
  1. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 10:41, 14 April 2018 (UTC) (see )
[[User:Pigsonthewing|Andy Mabbett]]
  • Primary needs: 1. username should be legible (reader's eye); 2. copy/paste name; 3. page searchable per visible name. 4. "Talk"-link clear. - DePiep (talk) 22:26, 17 April 2018 (UTC)
That's a bad example of bad, since it satisfies all four of your points. Mandruss  22:33, 17 April 2018 (UTC)
Userlink copy/pastes to: "Andy Mabbett", so User:Andy Mabbett. What is your question? - DePiep (talk) 22:37, 17 April 2018 (UTC)
Why can't you copy/paste from the source? There are a variety of easy solutions already available for this. Killiondude (talk) 22:40, 17 April 2018 (UTC)
1. Why must I? 2. Does it help reading, searching the talkpage? 3. Username can be hidden in irrelevant but disturbing code. (see source code from example #1; this is a simple example because it has no color & talkpage mixups). My question: did you yourself never met this situation? - DePiep (talk) 22:50, 17 April 2018 (UTC)
Andy gives the username following the userpage link.
Hey I agree with you in principle, I think the signature p&g should be improved and enforced. As a practical matter in the current environment, established editors are not going to change their sigs unless given a choice between that and a block, which is never going to happen. You might have some luck with a few new editors, the ones who haven't been here long enough to know that the community doesn't really care about compliance with signature p&g. Once they learn better, I suspect many of them will simply change back to what they had before. I think any improvement to the p&g is largely a waste of time. Mandruss  22:54, 17 April 2018 (UTC)
So now you say like: 'established users won't give up their privilege'. Sure, if that is how Wikipedia works. I repeat: usernames in talkpages should be open&clear this way, because it is a website. - DePiep (talk) 18:14, 19 April 2018 (UTC)

Autoblock detector tool broken?

The autoblock detector tool at https://tools.wmflabs.org/xtools/autoblock/ just seems to list all autoblocks, regardless of the username entered. Surely this is not the intended behavior? Can someone please investigate? -- The Anome (talk) 19:50, 17 April 2018 (UTC)

When you hit submit it's just redirecting to that wiki's Special:AutoblockList. The old tool didn't actually work anyway, at least at the time we retired it. What is the expected behaviour? Would the username pertain to the originally blocked user, or the blocking admin? For privacy reasons we can't reveal the account/IP that was autoblocked. MusikAnimal talk 19:50, 19 April 2018 (UTC)

Mapping content of different language articles to English

I find that Russian articles frequently deviate from English articles - to a point where false or misleading information is disseminated. For example, Echinacea (corn flower) has no reference in English that it may be used to isolate/purge radio-isotopes from the human body, yet this claim is made in the Russian version. So, there should be a simple translation program used (Google) to compare languages of the same article for words used that are not within the English (correct and trustworthy) version. A red flag would be raised and the article should be reviewed by a competent language volunteer to assure the reliability and accuracy of foreign language entries. Thanks!  Preceding unsigned comment added by NM Remote (talkcontribs) 05:13, 12 April 2018 (UTC)

I trust Google Translate even less than I trust a poorly-referenced Wikipedia article. --Redrose64 🌹 (talk) 07:25, 12 April 2018 (UTC)
Just chiming in to support Redrose64's comment; my feeling is the same as theirs. Mathglot (talk) 07:40, 12 April 2018 (UTC)
I'm not surprised by the claim; it's one of hundreds of miraculous-seeming claims for that plant. What you wouldn't find is any WP:MEDRS-qualifying sources that support such a claim. User:Jytdog or User:Alexbrn, do you know any editors who can read Russian and might be interested in looking into this report? The idea of being able to automatically identify significant differences might be a good one (e.g., it could help us find new content, so we could expand our articles), but in the short-term, it's possible that we could find someone to review that article and make sure that it meets that community's standards. WhatamIdoing (talk) 23:24, 19 April 2018 (UTC)
Thanks for the invitation but I don't read Russian and my hands are overfull dealing with woo-pushers here. Sorry. Jytdog (talk) 23:30, 19 April 2018 (UTC)

commons.wikimedia.org Log in problem

"There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking. Please resubmit the form."

Z75SG61Ilunqpdb (talk) 23:23, 19 April 2018 (UTC)
Fixed: logout, delete all wikipedia and wikimedia cookies, login to wikimedia, login to wikipedia, now OK.
Z75SG61Ilunqpdb (talk) 23:31, 19 April 2018 (UTC)

Updating Good article lists

Hi. I have a few requests relating to maintaining good articles and was hoping I could get some help from the technically minded folk here.

  • Update articles that have been passed as a good article, but do not have the {{good article}} template. Legobot does this after a review, but I have come across a few that do not have it.
  • Removing the {{good article}} template from articles that do not have it. This occurs usually when editors start a new article and copy paste from an existing good one.
  • Updating pages listed at Wikipedia:Good articles/all. This means removing ones that are no longer good articles and adding those that reviewers forgot to add.

We have Category:Good articles which lists article pages with the GA icon and Category:Wikipedia good articles which lists the talk pages with a passed review {{GA}}. There is a discrepancy of 25 between the two. There are about 2000 entries missing from Wikipedia:Good articles/all so that is where most of the work will lie. If it was possible to do it in petscan or some other tool that would be great as I could then run it myself in the future. Cheers AIRcorn (talk) 22:27, 19 April 2018 (UTC)

@Aircorn: I've created Wikipedia:Good articles/mismatches using AWB's list comparer. —JJMC89(T·C) 04:16, 20 April 2018 (UTC)
@JJMC89: Thanks a lot. That's perfect. I have AWB, but didn't even know about list comparer. I should be able to update the mismatches page myself in the future. AIRcorn (talk) 05:24, 20 April 2018 (UTC)

Aesthetic change

Quick note: The icons in the mw:2010 wikitext editor changed this week. I believe that it's just the latest phase of the years-long UI standardization work. It'll be in the upcoming issue of Tech News. Whatamidoing (WMF) (talk) 19:21, 20 April 2018 (UTC)

Discord

Sometimes References are split up in two or more subsections, each with its own sub-heading, say: ===Notes=== and ==-Citations===. Some editors happen not to like to have these sub-heading visible in the TOC. Which is the correct way to proceed:

  • {{TOC limit|2}}, which of course affects all subsections of the same level,
  • or
  • {{fakeheader|level=3|Notes}}, which has a punctual scope, but maybe also other technical drawbacks?

Thanks. Carlotm (talk) 08:23, 19 April 2018 (UTC)

Just because some editors don't want that doesn't make them right. WP:PSEUDOHEADTheDJ (talkcontribs) 08:49, 19 April 2018 (UTC)
Apparently 227 articles use fake heading template Galobtter (pingó mió) 10:27, 19 April 2018 (UTC)
So, the response is, do whatever you like? Carlotm (talk) 20:50, 19 April 2018 (UTC)
No, the response is DONT use Pseudo headings (like the guidelines tell you). Secondly don't fret so much about what goes into the ToC, it's an automated system, you can't control everything, just because you want to (which is why it's easier to use than LaTeX). And then be prepared for most people just doing whatever they want anyways. —TheDJ (talkcontribs) 22:40, 19 April 2018 (UTC)
Okay, that is the most sensible thing I've read on Wikipedia in a very long time. Thank you for the smile, TheDJ - not to mention the reality check. Risker (talk) 00:38, 20 April 2018 (UTC)
Thanks TheDJ. I'll try to enforce the DONT. Carlotm (talk) 21:04, 20 April 2018 (UTC)

making input box responsive

Is there any way by which one can make the <inputbox></inputbox> responsive to screen size using divs  FR+ 11:13, 20 April 2018 (UTC)

Do you have an example where you would want to apply this ? —TheDJ (talkcontribs) 12:55, 20 April 2018 (UTC)
TheDJ-User:FR30799386/Main Page  FR+ 16:10, 20 April 2018 (UTC)
@FR30799386: the problem is not the inputbox, it's the divs around it. You want a responsive gridlayout, for which you can best use flexbox layouting or display:table-cell —TheDJ (talkcontribs) 22:04, 20 April 2018 (UTC)

Checking "watch" box in edit action box doesn't put article on watch list

For some time now, my checking the "Watch this page" box in the edit action box doesn't accomplish what it used to, and I have to click on the star in the top-of-page tab bar to put an unwatched page on my watchlist. I'm using Firefox 59.0.2 (32-bit) under Windows 7. Dhtwiki (talk) 23:19, 19 April 2018 (UTC)

I have Firefox 59.0.2 (32-bit), but Windows 10. Clicking the "watch" box in the edit action box just worked for me. Are you using NoScript? If so, try disabling NoScript, and then checking the watch box. The latest version of NoScript interferes with much that it used not to. In my case, when I need to, I disable NoScript, change what I need and save, then re-check NoScript. — Maile (talk) 23:27, 19 April 2018 (UTC)
I used to, but no longer, use NoScript. However, I have been using Private Browsing, which may be the cause. I'll look into that. Evidently, the feature is working for others. Thanks for the reply. Dhtwiki (talk) 03:39, 20 April 2018 (UTC)
@Dhtwiki: I use Opera 36, no private browsing, no noscript. If I edit a page (or section) and check "Watch this page" and save, the top of the page doesn't update the watch star (tab if you use MonoBook skin); but if I reload the page (or go to page history) and check the tabs at the top, it shows as being watched; it also gets listed if I go straight to my watchlist after saving. To my mind there is some sort of caching delay such that an older version of the page is being displayed. --Redrose64 🌹 (talk) 07:02, 20 April 2018 (UTC)
I had a couple of user-warning templates to give out tonight, the usual cause of my putting new pages on my watchlist. I checked the box, then when the watch star showed white after I published my edit, I refreshed the page and the star showed blue. So, mystery sort-of solved. Thank you for pointing out the possibility of, what?, more aggressive caching on Firefox's part? Dhtwiki (talk) 03:56, 21 April 2018 (UTC)

Recently, when a cursor is over a link, there is a photo and a summary of the article. This is particularly bothersome when looking at an editor's contributions. It is also not helpful with articles as it can block a large portion of the text of the article.

Where can there be a discussion on ending this new practice? AN? Or somewhere else? Vanguard10 (talk) 02:52, 21 April 2018 (UTC)

@Vanguard10: it sounds like you have enabled NavigationPopups in Special:Preferences#mw-prefsection-gadgets - check if you can disable it there. — xaosflux Talk 02:57, 21 April 2018 (UTC)
Or possibly page previews at Special:Preferences#mw-prefsection-rendering. --Izno (talk) 03:29, 21 April 2018 (UTC)
If there is a gear wheel at the bottom right to disable it then it's mw:Page Previews. You can post feedback on the talk page. PrimeHunter (talk) 09:27, 21 April 2018 (UTC)

Special:Notifications

I'm getting an error of: PHP fatal error: Argument 1 passed to EchoEventPresentationModel::getTruncatedTitleText() must be an instance of Title, null given when I visit this page. It's the same on desktop and mobile. The buttons in the toolbar work fine SmartSE (talk) 22:51, 18 April 2018 (UTC)

Works for me --Redrose64 🌹 (talk) 22:54, 18 April 2018 (UTC)
@Smartse: Works for me too. This may be an issue specific to a certain notification you have received; you may like to file a Phabricator task. — This, that and the other (talk) 01:32, 19 April 2018 (UTC)
@Redrose64 and This, that and the other: Thanks for looking. It's still not working for me so will file a report. SmartSE (talk) 11:24, 21 April 2018 (UTC)

Special:RandomInCategory

In its present form, Special:RandomInCategory is not very useful because it does not support subcategories. If, for example, you want a random scientist, you could try typing in Scientists for the category; but Category:Scientists has 25 subcategories and 17 articles, all of which are there because someone did not bother to classify them properly. Not a very representative sample! Are there any plans to expand its functionality? If not, is there an alternative way of finding random articles? RockMagnetist(talk) 19:10, 20 April 2018 (UTC)

Wikipedia:Random lists randomlink.js. The documentation mentions randomlink_hops but the script hasn't been edited since 2010 and the author is inactive. I don't know whether it works. PrimeHunter (talk) 09:34, 21 April 2018 (UTC)
I had looked at randomlink.js and didn't think that it would be useful for finding articles in a category; but now it occurs to me that one could run CatScan V2.0β and then use randomlink.js on the output. RockMagnetist(talk) 16:01, 21 April 2018 (UTC)

API calls "by hand" within Pywikibot: no public-facing method... why?

Background: I wanted something equivalent to the API's action=parse&prop=sections to use via Pywikibot. After some searching, I found the following in pywikibot/site.py's source code:

    # TODO: expand support to other parameters of action=parse?
    def get_parsed_page(self, page):
        """Retrieve parsed text of the page using action=parse."""
        req = self._simple_request(action='parse', page=page)
        data = req.submit()
        assert 'parse' in data, "API parse response lacks 'parse' key"
        assert 'text' in data['parse'], "API parse response lacks 'text' key"
        parsed_text = data['parse']['text']['*']
        return parsed_text

The TODO note lets me think that (for now) PWB implements only a small subset of the action=parse API, and in particular not what I wanted, but please let me know if that is wrong. However, that snippet hints at low-level methods that allow a dirty hack to make arbitrary API calls; the output of the API's https://en.wikipedia.org/w/api.php?action=parse&prop=sections&oldid=837538913 can be obtained via

import pywikibot
# Define subfunction for arbitrary API calls
def manual_API_call(site, **kwargs):
    """Make API request by giving parameters 'by hand'."""
    request = site._simple_request(**kwargs)
    return request.submit()

# Pass parameters by hand
def find_sections(site, pagerevision):
    params = {'action': 'parse',
              'prop': 'sections',
              'format': 'json',
              'formatversion': 2,
              'oldid': pagerevision,
              }

    return manual_API_call(site, **params)

print(find_sections(pywikibot.Site(), 837538913))  # same output as web request https://en.wikipedia.org/w/api.php?action=parse&prop=sections&oldid=837538913

Is there a PWB equivalent to the low-level API call manual_API_call defined above? If no, why not (since all the machinery is in place)? Defining it myself does not look great to me, since we are calling a "private" method of the pywikibot.APISite class, and this looks like bad practice to me. For instance, if _simple_request gets renamed or changed in the future, the above snippet will stop working, but the rename/change itself will not be marked "breaking" by PWB devs (since that is not a public method). TigraanClick here to contact me 15:28, 21 April 2018 (UTC)

@Tigraan: I don't know if there is an equivalent to your manual_API_call, but you can avoid using the private method. Add from pywikibot.data.api import Request after line 1, and change line 5 to request = Request.create_simple(site, **kwargs). —JJMC89(T·C) 18:29, 21 April 2018 (UTC)
Sweet! So it does exist, actually. Thanks! TigraanClick here to contact me 19:29, 21 April 2018 (UTC)

Pywikibot login doesn't read password file. Help/more doc? (on Toolforge)

So, the background is that I set up an account for Muninnbot on Toolforge. The bot should use Pywikibot's predefined login.main() to login, but I cannot make it to work. I believe I have read, understood and followed the instructions from the Toolforge manual for using PWB's shared install, as well as Russell Blau's starter on PWB.

I may have missed some doc because from what I can read I followed all the steps. Details with ssh sessions on Toolforge etc:

More information Simple session - login on Toolforge as the tool account, run login.main(), abort (ctrl-C) when credentials are requested ...
Close
More information Same problem, but with a non-interactive session (so it aborts because stdin is EOF) ...
Close
More information I believe I have a correct setup for my password file ...
Close

I tried following the stack trace around PWB's source code to understand what is going on, but frankly I got lost fairly quickly. TigraanClick here to contact me 19:51, 15 April 2018 (UTC)

@Tigraan: What are using the login script for? If you just need to login, then try using something like this.
import pywikibot
site = pywikibot.Site() # or site = pywikibot.Site('en', 'wikipedia')
site.login() # Logs in
site.logged_in() # Test if logged in
JJMC89(T·C) 04:00, 16 April 2018 (UTC)
@JJMC89: the exact same problem occurs with your code snippet (I had already tried using the pywikibot.Site().login() but did not keep the logs so I wanted to make sure to execute your exact snippet). It asks for the password (so it is a no-go in non-interactive session), and the stack trace points to similar places.
More information details for the stack trace but it is similar to above ...
Close
The intent is to login the bot and use scripts.add_text to post notifications. But I just don't manage to get the password file right. TigraanClick here to contact me 18:11, 16 April 2018 (UTC)
@Tigraan: My guess is that you're using the password for that account that you use for the web interface or the file permissions of the password file aren't correct. You should use OAuth (or BotBasswords). If you add me as a maintainer, I can poke around. —JJMC89(T·C) 02:52, 17 April 2018 (UTC)
@JJMC89: File permissions allow reading (see "I believe I have the correct setup for the password file" in the OP), unless Pywikibot does something funky (e.g. run from another account) but I do use the same password as for the web interface. Is that wrong? I will try OAuth instead in any case. Will keep you updated. TigraanClick here to contact me 08:22, 17 April 2018 (UTC)
@Tigraan: The passwords file in my directory is 700 (executable). It doesn't use another account, but there have been a number of breaking changes to the API action=login. Basically Pywikibot must use OAuth or BotPasswords instead of the username/password used for the web interface (interactive login). —JJMC89(T·C) 14:29, 17 April 2018 (UTC)
@JJMC89: I got an owner-only OAuth consumer at meta:Special:OAuthConsumerRegistration, added its content in a {{{1}}} line in user-config.py as described in mw:Manual:Pywikibot/OAuth (after having chmod 700 that file of course), and now it works. Many thanks! TigraanClick here to contact me 19:35, 21 April 2018 (UTC)
Resolved

Reference misalignment

selective transclusion

Bug in "Articles created" tool in XTools

Image displaying at 90-degree angle

Feedback from rollbackers and admins wanted: planned changes to rollback action

Tech News: 2018-17

Moving a page to an /Archive

Wiki sending to a dangerous site?

Cursor insertion point

mw-datatable no longer highlights

How do you transclude a lead only?

How hard would it be to set up ORES for the Draft: space?

Any auto-hyphenation yet

education program preferences

Condition limit reached

Tidy no longer running

Strange interwiki problem

Google translate Terjemahan

Category problem

Listing category members in a module or template

Mysterious extra checkmarks

IP edit requests

AWB request

Is there any way for PAGESINCATEGORY to show how many pages that appear in both of two categories?

Tech News: 2018-18

namespace picklist

Refactoring of modules

MySQL and Toolforge

Wikimedia doesn't play midi files inline

Reference archiving bot

Mapframe maps now work on English Wikipedia

Wikipedia:Press coverage 2018 Revision history statistics piecharts

Who did what to the source editor?

Granular blocking tools (per page, category, namespace, & uploading files)

Any idea why non-Latin terms don't index?

1 won't go away

Prevent auto edit launch

How to deal with URLs that change as you click them

Wikitext highlighting out of beta

API Logins being refused

Test for the non-existence of a (possibly empty) third positional parameter?

Multiple infobox

Linking articles in different languages with different names

Tools to comment/uncomment categories?

Recent change breaks scroll in p-cactions menu

Page translation

Gadget issue

Autorollbacker userright

Tech News: 2018-19

How to find intitle matches for redirects in a category?

Random picture of the day and {{rand}} flags

AdvancedSearch

Update on page issues on mobile web

Good Article/Mismatches

Bidirectional isolation bdi

Regex find in string?

Need Help with variables and conditional logic in templates

"a failed attempt to log in to your account" alerts

Page performance study on other wikis

Control level of section auto collapse in mobile

"Page previews" doesn't show image

TOC broken on my watchlist

Something's wrong with 'unsortable' column headers

Hidden text

can I check my contributions across all Wikimedia sites for hacked login?

Odd templating issue

Search string

Wikipedia bug?

Feedback round: A proposal for referencing sections of the same work more easily

Possible spambots targeting Wikimedia mailing lists

A technical question

if login doubtful or fails, send email at that moment, not later

Issue with blackscreen gadget and Notices

Simple way to extract DEFAULTSORT?

Tech News: 2018-20

JavaScript programmers needed at WT:WPPORT

jquery to move rollback button

Article history

Template screwed up at San Fernando del Valle de Catamarca

Code Available to "Spin" Planets/Moons?

One of my gadgets stopped working correctly

Searching the edit filter log now requires you to fill out the title

How did Trump Derangement Syndrome end up on my watchlist while I was offline

User sandbox pages in mainspace categories

last_active API

wikitable css

Template:Infobox_writer – feedback request

MusicBrainz in authority control box

Tech News: 2018-21

Show only a part of an image?

Russian, Japanese, and French Wikipedias will be read-only for a few minutes next Tuesday

Is there a way of having a collapsable list similar to how the CategoryTree extension displays

Specifying an image width as a percentage of the screen rather than a number of px

"Sorry! This site is experiencing technical difficulties"

Searching among drafts among a particular category

Adblock Plus is blocking something in popups

Phabricator login broken?

I seem to have stopped receiving email notifications

Why are these inline CSS and not in Common.css?

Undo broken?

Help compiling a list of editors by experience level

deduping refs?

extract all infobox of article

Help please! – I can't type a tilde

Suggestion: sock-catching edit filter

Importing Template:efn to other wikis

Section edit links missing on article talk page

Tech News: 2018-22

Putting a <references> before a reference

Error tracking category added by translation tool

Potential replacement for Template:Rp

"Watch this page" and "This is a Minor edit" tickboxes in Safari

Collapsible sections of tables?

Search Index

webrecorder.io for |archiveurl=

Hundreds of broken talk archives

Issue with editing - End of paragraph and "return"

Anti-vandalism bots and the bot flag

Introducing Toolhub

Related Articles

Wikiwand AI