[05:03:17] Any ideas for diagnosing a badtoken error while POSTing an edit request? [05:37:43] enterprisey: most likely an encoding issue [05:37:58] legoktm: thought of that as well [05:38:03] enterprisey: try and inspect the HTTP request? [05:38:12] right now, on the wire it looks like it's been properly uriencoded [05:38:33] ends with %2B%5C%5C and everything [05:47:39] enterprisey: uh, isn't that your problem? :) there should be only one %5C [05:47:50] really? [05:47:51] OH [05:47:53] OH MAN [05:48:04] I just realized the API call meta=tokens returns two slashes [05:48:06] but that's because [05:48:12] IT ESCAPES IT WHILE PRETTY-PRINTING [05:48:15] are you not using a JSON parser? [05:48:34] !debug | harej [05:48:35] harej: For information on debugging (including viewing errors), see http://www.mediawiki.org/wiki/Manual:How_to_debug . A list of related configuration variables is at https://www.mediawiki.org/wiki/Manual:Configuration_settings#Debug.2Flogging [05:48:35] legoktm: let's say that the project is in an early stage [05:48:40] enterprisey: :) [05:48:50] I'm doing the early Dispenser era login strategy [05:49:05] i.e. have the user copy-and-paste CSRF tokens from an iframe [05:49:12] eventually I'll get OAuth up and running [06:03:10] legoktm: hmm [06:03:26] I fixed the slashes issue, but it's still broken [06:03:54] enterprisey: why are you not just using oauth? [06:04:10] to be honest, I was a bit too lazy [06:04:26] I'm not aware of a simple way to use it in a Labs JS app [06:04:35] I'm reading through the wikidata game source, though [06:04:42] (for clues) [06:04:54] I think you're laziness is going to cost you more than just doing oauth properly :P [06:05:12] yeah [06:05:20] but won't oauth just give me a token as usual? [06:05:24] you need a server-side component, so just have the JS hit your server's API endpoint, which makes a server-side API request to MW [06:05:32] yes but I assume you'd be using a standard oauth library then [06:05:35] that's what I'm doing right now [06:05:44] I have a CGI script that hits the API [06:07:38] I'm just not sure why the token I get from the API is invalid [06:11:43] enterprisey: https://github.com/wikimedia/mediawiki-oauthclient-php might (or might not) help. [06:12:09] Niharika: thanks for the library [06:12:20] (I'm using JS, sadly :) ) [06:12:33] Ah. [06:14:42] https://www.mediawiki.org/wiki/OAuth/For_Developers#Demo_Time.21 has a list of libraries that people had success using [06:34:41] seems fine to me [06:34:53] oops wrong channel [12:24:41] hi, how can I ban Api to unregistered users? [13:38:31] auvajs: why? [15:51:56] p858snake: I have my reasons for it [16:02:38] prop: revisions, rvprop: content seems to have been changed since yesterday already... https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=The+Battle+Pavane&rvprop=content&rvlimit=max [17:46:12] API: what's the best way how to get the author of a particular revision? [17:47:10] auvajs: Web API or PHP API? [17:48:07] MTres19: there are two apis? :) I didn't know that.. [17:48:35] MTres19: the one via api.php? [17:48:40] probably the web api [17:48:48] auvajs: Yes, that's the web API. [17:49:20] Sorry can't help you with that. I've never dealt with the web API. [17:51:10] auvajs: https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Main%20Page&rvprop=user [17:51:28] https://en.wikipedia.org/w/api.php?action=help&modules=query%2Brevisions [17:55:03] Reedy: I have some particular rev number, eg 666666 and I want to know the user [17:55:16] easy [17:56:24] when I try api.php?action=query&format=json&prop=revisions&revids=666666&rvprop=user&rvlimit=max I get an error [17:56:44] {"error":{"code":"invalidparammix","info":"\u29fcapierror-revisions-nolist\u29fd","*": [17:57:18] https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=user&revids=666666 [17:58:22] Reedy: tnx