Tech
A place to talk about tech related to a Wikimedia wiki.
Have a technical wiki question? Ask here. This can include, for example:
- requests for new tools, scripts, and bots;
- help with CSS or JavaScript;
- API help;
- and data collection help (including database queries).
Please sign by entering four tildes (~~~~) or by clicking on the signature icon ; this will automatically produce your name and the date.
Adding comments and quotes by the visual editor[edit]
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[edit]
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[edit]
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)