[01:54:48] !ops Join Flood [Sigyn-] [02:01:21] what is up with all the flooding today [10:07:26] Q: ParserFunctions is still the only way when you have multi-valued templates, right? [10:07:51] (long time since I did advanced templates, so feeling rusty) [10:08:23] Sorry, "when you have multi-valued template parameters", I mean [10:14:38] Ah, I should read instructions better ... see now that it is bundled witn MW. Never mind. [13:41:14] Hi samuell. [13:41:20] There's also Scribunto/Lua now. [14:15:01] Debra, Ah, right ... I should check it out a bit yea [14:15:14] (Only heard about it, but not really got my head around it) [14:20:07] Hello, is there a way to get contributions for all users based on a specific tag? [14:33:32] okay, so i can view recent changes with a tag filter, but im not sure how the tag filter works. For example: https://commons.wikimedia.org/w/index.php?namespace=&tagfilter=Mobile+app+edit&translations=filter&hidebots=&limit=500&title=Special%3ARecentChanges [14:33:55] where tag filter is "Mobile app edit" and shown in the list when that field is empty [14:34:55] okay, never mind it was "mobile app edit" with small m. The id of a tag != whats shown in the search results [14:38:00] chippy: From where? API? PHP? JS? DB query? [14:38:33] Reedy, it was via php - I think I've figured out how to get tags working in queries now, thanks :) [14:38:47] (at least for recent edits anyhow) [15:09:20] samuell: It's used a lot on the English Wikipedia these days, I guess. [15:09:42] Debra: It's overused in my opinion [15:19:45] Why is it overused? [15:19:56] It's easier to read, it's a fucking programming language you can use on a wiki page [15:20:02] Rather than a template clusterufck [15:20:54] Reedy: Hi. [15:20:56] Calm down. [15:21:05] I'm not sure I'd say overused. [15:21:12] Debra: Make me. [15:21:24] But I find some of the modules a bit overwhelming, personally. [15:21:24] Reedy: language please... [15:21:34] Meh [15:21:44] Zppix: ParserFunctions make people rage. :-) [15:21:48] {{{{{{{{ oh god }}}}}}}} [15:21:50] i can see that [15:22:01] Zppix: Are you a wiki editor (yet!)? [15:22:06] I'm not sure I've seen you around. [15:22:16] Debra: i'm a rollbacker and a Pending Changes Reviewer on enwiki [15:22:20] Ah, nice. [15:22:28] and ext auto confirm [15:22:29] I'm a troublemaker and sassmaster on all the wikis. [15:22:33] Debra: tsk tsk [15:22:35] extendedconfirmed! [15:22:39] For life. [15:23:05] Debra: do you use AWB? [15:23:09] Debra: You just run Wikimedia [15:28:52] Zppix: Not really. I have in the distant past. [15:28:58] Getting Windows or WINE was always annoying. [15:29:04] Many years ago I used AWB with an auto-clicker. [15:29:08] Such technology. [15:29:14] Debra: ah, i use AWB, huggle, and sometimes stiki [15:29:20] Since I refused to compile it myself or get added as a bot, I guess. [15:29:29] I edit manually a lot these days. [15:29:31] It's more rewarding. [15:29:36] But also slow and tedious. [15:29:51] Debra: i do not do much creating articles, i do alot more copyediting then any other manual editing [16:57:49] I am using Google Apps Script and am having a problem getting the edit API to work. If you have familiarity with this, could you please let me know. I would really appreciate your assistance. [17:00:11] freerangegames, just state your problem [17:05:43] I have successfully logged in and also was able to get (what I belive is) a valid edit token using api.php?action=query&format=json&meta=tokens. However when I go to use the token, I get a "badtoken" response. I'm happy to share my code with someone who is interested, but didn't want to just spam it here. [17:14:49] which MW version? [17:14:49] freerangegames: you are not URL-encoding the token correctly, or you're not parsing JSON correctly [17:15:05] freerangegames: the token ends with '+\' to catch this kind of errors [17:15:25] freerangegames: you should also verify you URL-encode the content you send correctly, otherwise you're going to corrupt pages when editing. [17:16:58] Let me check on the version. I believe it is 1.27. It's the Curse Gamepedia mediawiki. [17:17:17] oh [17:17:21] then it's cursed [17:17:31] that explains your problems ;) [17:17:38] I believe I am encoding it correctly. I'll post my request headers in a moment. [17:18:08] I wish metaphysics played into this Platonides. I'm sure there is some voodoo I am missing. [17:19:40] http://deadwood.gamepedia.com/Deadwood:_The_Forgotten_Curse_Wiki ? [17:20:38] Gamepedia version: 1.26.3 (7000e32) [17:21:47] Here are the request headers: [17:21:49] {headers={cookie=__cfduid=d0d653e1e90a03a77375c8e1dc90d72fd1470935939;ABVersion=stable;network_session=RE9A9xreOu%2F8%2F6ewnl%2Fry39TLzAnNx6VWrYpz7bJNarr9cCQWdlAtHobLkhHLqGqzb91T8QzoOWfWJErwn0vbhxOFplT9Odx4CMdx4cVyjQNc2mh1Mi%2B2QuZkYF3bap5A96rlb8fNEHvoAyZyivr7mRCex4qtGa9sKLKRZLo27E%3D%7CMC7bInSyOso%2Fs%2FmCnURVrZdaNr2vJ2aYqbB8WZI763E%3D;labyrinth_gamepediaUserID=4942;labyrinth_gamepediaUserName=Freerangegames;labyrinth_game [17:22:18] gah, cut off... [17:23:45] Here are the method and payload ones: [17:23:46] method=post, payload=summary=test&format=json&action=edit§ion=new&text=hello&title=test&token=8ceeb774f4bec4e6b29b076fa0f750b257acb385%2B%5C, followRedirects=true, validateHttpsCertificates=true, useIntranet=false, contentType=application/x-www-form-urlencoded, [17:24:32] As you can see, I have the '+\' encoded as: %2B%5C [17:26:09] * Nemo_bis hates +\ [17:48:11] My internet went out. Gees, serious problems. [17:48:58] Anyway, I checked the channel logs and it doesn't seem like anyone has any ideas what I'm doing wrong. [17:49:11] If I missed something, please let me know. [17:49:55] If anybody has any ideas who or where I can ask for help, please let me know. [18:11:35] Is there a channel devoted to Scribunto/Lua? [18:15:31] sigilbaram: I don't think so [19:14:44] I was wondering if it's possible to have a lua module set a variable that can be used by other modules later on the page, similar to the #vardefine parser function. [19:53:17] MIERDA.. PUTA LA WEA [20:50:38] Platonides, it looks like you are one of the mods here. Joking about how I'm curse aside, do you know if I'd have a better chance of getting help in #wikimedia-dev? [20:51:30] freerangegames: I would send an email to mediawiki-l [20:51:33] freerangegames: i've a developer what are you needing? [20:51:45] i'm* [20:51:48] he has some problems using the api [20:52:04] Oh okay would you like to explain a bit further freerangegames ? [20:52:19] Hi Zppix, thanks. [20:53:33] I am using Google Apps Script and am getting badtoken errors even though I believe I'm requesting the edit token correctly including urlencoding it. [20:54:20] This is with an extentsion or the base mediawiki files? [20:55:02] I don't understand that question, but I'm assuming base mediawiki files. [20:55:25] I am trying to write to Curse's Gamepedia. It uses mediawiki version: 1.26.3 (7000e32) [20:55:26] Okay let me attempt to rephrase did you download an extentsion? [20:55:31] oh [20:55:32] ok [20:55:48] no I did not, but I think you see why now [20:55:52] Umm let me take look at my resources and i will attempt to help you fix your issue. [20:56:02] Thank you very much [20:57:03] Can i have the exact error message please? [20:57:11] Just one sec [20:57:36] Take your time! [20:57:47] {"error":{"code":"badtoken","info":"Invalid token","*":"See https://labyrinth.gamepedia.com/api.php for API usage"}} [20:58:10] How are you sending the token back? [20:58:18] wow Reedy you read my mind.... [20:58:35] I suspect I've been doing API stuff longer than you have ;) [20:58:36] This is from my request headers: method=post, payload=summary=test&format=json&action=edit§ion=new&text=hello&title=test&token=5211eff3e012adfcb165027cde1d255557ace6b0%2B%5C [20:59:32] I used single words for text, title, etc. so I wouldn't have to urlencode them, but I doubt that's the problem. [21:00:39] It looks like Google Apps Script automatically urlencodes '+\' because if I do it ahead of time then I get a longer string where it looks like Google is urlencoding the '%' [21:00:56] be sure you're preserving the session cookies [21:01:00] In that case, I also get a badtoken error, which would be expected [21:01:12] cookies is a good shout [21:01:17] I'm sending all the cookies that I got when I requested the token [21:01:43] what content-type is being sent with the request headers? [21:01:44] That tripped me up earlier when I was just trying to request the edit token. But I have that sorted out now. [21:02:13] That too should be correct: contentType=application/x-www-form-urlencoded [21:02:19] yeah that looks right [21:02:24] That's what google defaults too, btw [21:02:43] just double checking, since that's the second thing I thought of after cookies :) [21:03:02] I'm happy to show you my code, if that would be helpful [21:03:30] Another thing i could think of is maybe your trying to request an token invalidly such as an outdated token or such [21:03:44] and double-checking that you're passing the correct token [21:03:47] or that it isn't an edit token [21:03:51] but a token of another kind [21:03:57] ^ that too [21:05:10] I immediately get the token back and use it right away. I assumed it was an edit token. I used api.php?action=query&format=json&meta=tokens [21:05:26] you need the "csrf" token from action=query&meta=tokens, that is the default token returned however [21:05:43] It returns a csrftoken [21:06:10] I notice on my wiki that the token ends with 2 backslashes, not one [21:06:16] er wait [21:06:18] that's just json escape [21:06:20] nvm [21:07:12] that threw me off too at first [21:07:57] Here's my code: https://dpaste.de/NWW4 It's all one function and needs some cleanup, but that's just because I've been trying to get it working. [21:09:20] BTW, the mediawiki documentation should be updated to mention that the sessionID name is now global_session. That gave me some headache when I was trying to figure out how to authenticate. [21:09:51] freerangegames: line 82 looks suspect [21:10:13] it looks like you're erasing all the cookies returned from action=login [21:10:36] rather than merging them together [21:10:56] the session cookie name varies by wiki, there is no one fixed value [21:11:21] freerangegames: I will fix that asap [21:13:03] Skizzerz, hmmm. I had looked at both sets of cookies previously and they looked the same. I could have missed something however. I had thrown that second set in just to test to see if I got back a different set of cookies. [21:13:27] I'm not really a web guy, so dealing with cookies is new to me. [21:13:36] idk, I haven't tried actually doing it myself yet, so this is just talking off the top of my head [21:13:42] Would I need to merge the cookies from one call to the next? [21:13:45] it's possible that it returns the complete set of cookies each time, but seems odd to me [21:14:24] * Skizzerz heads off to check [21:14:29] Let me run a quick test [21:18:10] Hold on, something odds happening when I print the logs of cookies in both cases. The second one might not be formatted correctly. I have to figure out why. [21:19:32] freerangegames: do you know which documentation that needs updating exactly? If not I can look it up [21:20:12] just the standard login API doc [21:20:30] Alrighty thanks! [21:20:37] https://www.mediawiki.org/wiki/API:Login [21:23:11] I think it may of already been fixing considering you are running 1.26 and the latest is 1.27 [21:23:17] fixed* [21:28:56] So I was mistaken about the formatting of the cookies. I was just confused looking at my logs. It appears that my cookies from 'Set-Cookie' are identical after login and after the edit token request [21:30:19] Skizzerz: so, even though I am overwriting my cookies the second time, unless I am missing something, I don't think it matters [21:32:59] If I comment the 2nd cookie assignment out, and just use the cookies from login, I still get a badtoken error on the edit request. So no new information--as expected. [21:35:24] HHAHAHAHHAA [21:35:30] I AM COMETS [21:35:40] HOW ARE YOU [21:35:56] I LOVE ALEXZ [21:36:17] Zppix: what do you mean by "fixed"? If Curse upgrades to 1.27, will I need to change something? [21:43:40] I doubt there's a problem with edit tokens in 1.26, that's such a basic functionality to be broken and not fixed on the same release [21:52:43] freerangegames: im unsure [21:53:48] Well, I'll cross that bridge when I get there. Currently I'm stuck where I am. I hope Skizzerz or someone else has a brilliant insight [21:54:08] well I got the workflow to work on my wiki [21:54:32] really? [21:54:32] there is a single cookie, the session cokie [21:54:35] *cookie [21:55:34] freerangegames: you can enable a debug log on your wiki, it logs request headers, cookies, etc. There you can test if wiki receives the right bits. Well, I'm not sure if api.php requests are also logged [21:55:45] what I did was 1. GET action=query&meta=tokens&type=login to grab the login token. 2. POST action=login with lgname, lgpassword, and lgtoken set [21:55:51] Vulpix: I doubt it's his wiki [21:56:00] it's on Curse [21:56:16] It's not my wiki. It's on Curse, like Skizzerz said. [21:56:37] anyway, the POST reply should set a cookie, but even if you ignore that it gives you a cookieprefix and sessionid you can use to manually construct the session cookie [21:56:55] if you're capturing the cookie value, ensure that it matches the value returned by the login API [21:57:54] then 3. GET action=query&meta=tokens&type=csrf and 4. POST action=edit with the returned token [21:57:56] worked for me on my install [21:58:13] it's possible that curse broke it given that they do customize their wikis a bit [21:58:47] Skizzerz, did you use Google Apps Script? [21:58:50] no [21:58:55] did it in a local python repl [21:59:26] One of my worries is that Google's FetchURL object doesn't actually send the request header the way it says it does [21:59:51] Would Curse be able to see my request's headers in their logs? [22:00:05] most likely [22:00:09] er [22:00:15] headers? probably not [22:00:18] query string? yes [22:01:36] Also you using just the session cookie you used for step 2 also in step 3, or did you need to send all cookies in step 3? [22:02:15] Because when I tried to just use the session cookie in step 2 for step 3 as well, it failed. So I decided to just send them all. [22:03:40] the only session cookie that you need is the one from the successful login [22:04:47] Skizzerz: could it be an cookie from something non mediawiki related on the site interferring? [22:06:04] Skizzerz: If I just use the session cookie, then api.php?action=query&format=json&meta=tokens fails [22:06:36] I just tried it again to reconfirm [22:07:16] ok, I'm gonna try on your wiki [22:07:20] just in case there's something funky going on [22:07:25] Zppix: that's an interesting thought [22:07:26] API logins on gamepedia should work, i.e. pywikibot works fine. They did have some issues with API logins at one point because of redirects, but that has been fixed. [22:08:04] Skizzerz: for what it's worth, they Curse guys said they didn't know javascript and the one that kinda did, abandoned it and used pywikibot [22:08:53] that shouldn't matter [22:09:37] I would prefer not to use python because 1) I just started learning python 2 weeks ago, 2) have all my other bots written in Google Apps Script, and 3) our CTO wrote a script that gets all of our game data out of our game engine and puts it into a Google Doc spreadsheet, so I'd rather stay in that environment [22:11:03] I've written bots for Steam, Twitter, PayPal, Playfab, and Twitch and have never had as much trouble as Curse's mediawiki is giving me [22:11:51] freerangegames: python would be probably be more friendly with mediawiki [22:11:58] I'm seeing a bunch of cookies returned by the gamepedia API [22:12:05] But for Steam, I did run into a problem that uncovered a but in Google Apps Script and had to argue with one of their engineers for a long time because they didn't believe me. [22:12:35] bug* [22:12:36] __cfduid, network_session, ABVersion, global_session, labyrinth_gamepediaToken, labyrinth_gamepediaUserID, labyringth_gamepediaUserName [22:12:49] all of those just after a successful action=login API request [22:12:50] yep. I'm passing those all through [22:14:03] hmm [22:14:30] is there any sort of sandbox page I can fire test edits at? [22:16:07] When I made a different mistake before, I got the API Help page back. It had a message that said that 'all' accounts have API write access. I don't think they have a sandbox. Not that they told me about. [22:16:23] I don't mind you trying to edit https://labyrinth.gamepedia.com/Test [22:16:33] k [22:18:07] oh s**t. I figured it out [22:18:34] was just about to say that it worked for me :P [22:18:37] what was it? [22:19:41] I just looked more carefully at the cookies returned. I forgot to merge in the global_session cookie with the rest of the cookies. I was still get a token generated, but it was indeed a badtoken. [22:19:59] Thank you very much for taking all the time and effort to be my duck. [22:20:05] Sorry to waste your time. [22:20:38] I would suggest an improvement to mediawiki that a token is not generated unless all cookies are correct. [22:21:04] anonymous (logged out) editing is a thing, and that needs tokens too [22:21:11] although generally that's just a blank token [22:21:34] It would have been easier to figure out if it was a blank token [22:22:02] It was at one point? [22:22:04] Or just +/ [22:22:22] still is [22:22:27] +\, but yeah [22:22:48] I guess having some cookies set but not others was throwing it for a loop [22:23:17] it is, except you can send all header cookies minus the global_session cookie and get a fully formed token back that is invalid and will not work [22:23:56] I think 1.27 fixes that though [22:24:07] at the very least on my own wikis which were running 1.27 the only cookie was the session one [22:24:17] so if you miss that, you don't have any cookies to send :P [22:24:48] That's a nice improvement. [22:25:08] also improves the login workflow a bit [22:25:17] Anyway, I am happily relieved [22:25:24] and lets you have API-specific passwords with more restricted permissions [22:25:36] I seriously spent more than 20 hours banging my head on this problem before coming here [22:25:50] RIP [22:26:30] freerangegames: next time don't hesitate to come here there's usually 1 or 2 of us around, and we love to talk to people! [22:26:31] I thought twitter's multistep oath was overkill. [22:27:18] I didn't know about this IRC channel. It's amazing that IRC still exists. ;) [22:27:54] freerangegames: we have irc channels for majority of WMF related things [22:28:09] If you are interested in CCG's (like Hearthstone) we are making one in 3D called Labyrinth [22:28:45] Once I get the first draft of our Wiki page up on Curse, I'll let you know about it. :) [22:29:15] We'll be here! Feel free to hang out here if you wish [22:29:40] http://store.steampowered.com/app/412310 in case you are interested. It's a work in progress. [22:29:54] I'll keep it in the back of my midn. [22:29:56] mind* [22:30:08] I'll definitely be back if I have trouble. [22:30:51] Also, once my bot is written, I'll come back to get some advice on where to post my code. All the Google Apps Script examples out there are out of date. [22:31:59] freerangegames: https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions would probably be your friend then [22:33:06] I'll take a look. Thanks again Skizzerz and Zppix! ttyl [22:33:38] o/ [22:33:45] o/ [22:33:53] all my CCG money goes towards MtG, I can't afford another :P [23:16:15] Skizzerz: it'll be f2p ;) [23:43:19] !lts [23:43:19] Current long-term support release is 1.23. The legacy lts is 1.19 and will be supported until May 2015. https://www.mediawiki.org/wiki/Version_lifecycle#Versions_and_their_end-of-life [23:43:33] !lts del [23:43:33] Successfully removed lts [23:44:00] !lts is Current long-term support release is 1.27. The legacy lts is 1.23 and will be supported until May 2017. https://www.mediawiki.org/wiki/Version_lifecycle#Versions_and_their_end-of-life [23:44:00] Key was added [23:48:32] freerangegames: Sorry that I am a terrible duck. D: [23:52:59] Trela: You might not be the duck that I need, but you are the duck that I deserve. [23:53:07] * Trela coughs. [23:53:23] I am the Alexia you were emailing at Curse. >_>; [23:54:59] Well then, I do deserve you. [23:57:58] Trela: My bot's 'user-agent' says it's "LabyrinthBot". Let me know if it gets out of hand. [23:59:37] freerangegames: As long as the account it uses is flagged as a bot it should not get flagged for anything.