Tech/Archives/2024

< Tech‎ | Archives

Lua equivalent of mw:API:Categorymembers?

I'm working on commons:Module:Tricolor, and it would be useful if I could generate a list of all the direct subcategories of commons:Category:Combinations of 3 colors. It seems like the categorymembers API does something in this vein for JavaScript, PHP and Python. Is there a way to access this information from a Lua module? —CalendulaAsteraceae (talkcontribs) 09:18, 25 December 2023 (UTC)

@CalendulaAsteraceae: I don’t think there is. Due to the complexity invalidating the right caches, it’s not that easy to implement a such function – a problem that doesn’t exist when using the action API. —Tacsipacsi (talk) 21:22, 25 December 2023 (UTC)
Thank you, that's good to know! —CalendulaAsteraceae (talkcontribs) 07:52, 2 January 2024 (UTC)

CSS help for this page

I've made Tech/Header use CSS (Tech/Header/styles.css), which makes the page code look nicer and fixes the appearance of the "Ask a question" button. Based on the note at the top of the header page which says "this page contains changes which are not marked for translation" I assume I need to do something to make the changes propagate to this page; what is it? —CalendulaAsteraceae (talkcontribs) 08:41, 2 January 2024 (UTC)

Thanks for the improvements! The interface message is referring to an action that only Meta:Translation administrators can do, and one of them has done so. Thanks again. Quiddity (WMF) (talk) 23:46, 5 January 2024 (UTC)

HotCat gadget not working on hy.wikipedia

Hi! On Armenian wikipedia (hywiki) HotCat gadget is not working since January 5, 2024.

Please can you help to solve this problem!

Thank you in advance! Kareyac (talk) 16:59, 5 January 2024 (UTC)

@Kareyac: See mw:Help:Locating broken scripts for how you can investigate the problem yourself. Or maybe phab:T354416 is related. --AKlapper (WMF) (talk) 07:36, 6 January 2024 (UTC)
AKlapper (WMF), thank yu again. - Kareyac (talk) 07:45, 6 January 2024 (UTC)

search problems at Wk-kbd

Hi. On Kabardian wiktionary the palochka is causing problems with search. The problem is that they use the Unicode characters for cap and l.c. palochka, but people using the search engine will generally use the digit '1' or a capital Latin 'I' (occasionally Ukrainian Cyrillic 'I' or Latin l.c. el). These are not treated as equivalent by the engine, so no search results are returned. I assume the solution would be similar to how straight/curly quotes are treated, or apostrophe for Hawaiian okina. Where would be the proper place to go for this?

Thanks, Kwamikagami (talk) 23:54, 6 January 2024 (UTC)

@Kwamikagami: Following mw:How to report a bug and filing a feature request against CirrusSearch. --AKlapper (WMF) (talk) 08:18, 7 January 2024 (UTC)
Thank you! Kwamikagami (talk) 08:24, 7 January 2024 (UTC)

Admin Access Request

Hello,

IT sent me over here to request admin access for http://lists.wikimedia.org/. As part of the onboarding process, Ops adds new hires to that site. Please advise.

Thank you,

Ally Stariha AStariha-WMF (talk) 20:29, 19 January 2024 (UTC)

@AStariha-WMF Hi, I do some maintenance on lists.wikimedia.org. To my knowledge, a super admin account can't create new users. We don't have admin accounts for the whole site (only superadmin which has a pretty large access). If you want to add emails for new hires to some mailing lists (and remove them in case of offboarding), you don't even need to create an account for them, you can just add the email address directly. You just need to be admin in some mailing lists (like wmfreqs-l, etc.) and I can take care of that.
TLDR: What is your specific usecase and I can help you get it done. ASarabadani (WMF) (talk) 15:05, 22 January 2024 (UTC)

I cannot vote

I have been trying to hit the vote button for Turkmen's Steward campaign, but the message will not show up. Is my account not actually eligible to vote or is it something else? GoutComplex (talk) 15:11, 6 February 2024 (UTC)

@GoutComplex: You could try to manually cast a voce clicking on "Edit" if you're not able to see the script (maybe your javascript is disabled) :) --Superpes15 (talk) 15:14, 6 February 2024 (UTC)
@GoutComplex: Ah, just noticed, the right page is this one :) Superpes15 (talk) 15:16, 6 February 2024 (UTC)
Some users had such problems last year as well. The peculiarity is that all these users had few or 0 local edits. I think this happening because users are not autoconfirmed. In this case, need to add vote manually, through "Edit", yes. ❄️Mykola❄️ 15:21, 6 February 2024 (UTC)

Adding comments and quotes by the visual editor

I don't have the button to add comments and quotes. I really need this, and I'm pretty new to using mediaWiki. Would appreciate help. Nchmn (talk) 21:43, 12 February 2024 (UTC)

Question about using the MediaWiki API to edit pages

I want to use the MediaWiki API to edit pages. And when:

  • My query parameters include "token" (CSRF token), it told me "The following parameter was found in the query string, but must be in the POST body: token."
  • When I move it to the body of the POST, 'The "token" parameter must be set.'
  • No matter how I use it, it responds with a 301 error.

Is it something wrong with the server? Or my code... The content below is my code(in Dart):

final headers = {
  'User-Agent': 'WikiApp/1.0 contact: [email]',
  'Authorization': 'Bearer $credentials', 
};
final code = await http.post(
  Uri(
      scheme: 'https',
      host: fullServerName,
      path: '${wgScriptPath}api.php',
      queryParameters: {
        'action': 'query',
        'meta': 'tokens',
        'format': 'json',
      }),
);
var data = code.body;
final Map wikiTOC = jsonDecode(data);
String token = wikiTOC['query']['tokens']['csrftoken'];
final apiUrl = Uri(
  scheme: 'https',
  host: wgServer,
  path: '${wgScriptPath}api.php',
  queryParameters: {
    'action': 'edit',
    'format': 'json',
    'title': PageName,
    'summary': 'Edited via MyApp',
    'text': textContent,
    'token': token,
  },);


final response = await http.post(
  apiUrl,
  headers: headers,
);

--Creamycd (talk) 06:44, 17 February 2024 (UTC)

By the way, the full code has been MITed to GitHub--Creamycd (talk) 08:58, 17 February 2024 (UTC)

Sorry, wrong place --Creamycd (talk) 09:01, 17 February 2024 (UTC)

Getting Details Of Videos and Audio From the API

Dear,

I'm writing to follow up on my API call results. While I was able to successfully retrieve images and descriptions for my search keyword.

API: https://en.wikipedia.org/w/rest.php/v1/search/page?q=World&limit=2

I couldn't locate any information related to audio files & a video files.

Could you please clarify if audio & video files are included in the API response for this particular search? If not, is there another way to access audio & video files related to my search keyword on this platform using Specific API?

Thank you! UsmanKhanLodhi (talk) 07:29, 11 March 2024 (UTC)

OpenStreetMap does not work anymore

I have noticed that OpenStreetMap does not work in any wiki, including Commons, Wikipedia, Wikidata etc. Instead of showing a dynamic map from OpenStreetMap, it shows a white screen. I have noticed this thing in commons:Category:Kolkata and also in wikidata:Q1348. Sbb1413 (he) (talkcontribs) 18:41, 25 March 2024 (UTC)

Works for me. AntiCompositeNumber (talk) 01:26, 26 March 2024 (UTC)
I have now opened commons:Data:Lok Sabha constituencies/2019/West Bengal/Kolkata Uttar.map and it still shows a white screen without any dynamic map. Sbb1413 (he) (talkcontribs) 14:35, 26 March 2024 (UTC)
Map works fine here. Please check for relevant errors in your web browser's developer tools (network tab and console tab), and/or try a different web browser and/or internet connection. --AKlapper (WMF) (talk) 15:10, 26 March 2024 (UTC)
Thanks, it works! I've removed the following code in commons:User:Sbb1413/commons.js:

importScript('User:Kanonkas/twinkle.js'); mw.loader.load('//fr.wikipedia.org/w/index.php?title=Mediawiki:Gadget-KartoEditor.js&action=raw&ctype=text/javascript');

Sbb1413 (he) (talkcontribs) 15:17, 26 March 2024 (UTC)
However, after refreshing the webpage, the problem comes back. Sbb1413 (he) (talkcontribs) 15:20, 26 March 2024 (UTC)
See my previous comment: Please check for relevant errors in your web browser's developer tools (network tab and console tab), and/or try a different web browser and/or internet connection. --AKlapper (WMF) (talk) 15:53, 26 March 2024 (UTC)

Mediawiki latest file download problem

Anyone can gave me the solution of mine problem, because i downloaded the mediawiki and the file is corrupted. 72.255.3.43 10:01, 26 March 2024 (UTC)

Wrong place; see mw:Project:Support_desk instead (and provide way way more information there). --AKlapper (WMF) (talk) 15:09, 26 March 2024 (UTC)