User talk:Yurik/Query API/Completed Requests

From Wikipedia, the free encyclopedia

Contents

[edit] "revisions" action: rvcomments option: bug

with and without the rvcomments option, I recieve the same result, except that with it on the result is somewhat slower to arrive. See also the history page for that article for comparison. r3m0t talk 13:10, 19 May 2006 (UTC)

This bug has been fixed in the newer version, and should be published shortly. In the meantime, use rvcomments=true. --Yurik 03:57, 20 May 2006 (UTC)

[edit] Page Content

  • Get page content for current and previous revisions. Phr
Done for current revision, pending for previous ones. --Yurik 18:20, 1 June 2006 (UTC)
Done as part of revisions and as a separate content request. --Yurik 04:36, 2 June 2006 (UTC)

[edit] Pages in a Category

  • Can get pages in a given category using "category" parameter. --Yurik 20:45, 6 June 2006 (UTC)
  • to generate useful previews for categories, could your tool spit out the members of a category? Also it'd be cool if it could compute unions and intersections of categories. Lupin
    Partialy done - members of categories can now be retrieved using the "category" parameter (code is checked in, will be available shortly) --Yurik 20:44, 6 June 2006 (UTC)
  • Thanks! The union and intersection business is probably a bit fanciful - I can't think of a good application at the moment :) Lupin|talk|popups 23:00, 6 June 2006 (UTC)
Postponing unions, etc, until later. --Yurik 17:21, 8 June 2006 (UTC)

[edit] User Contributions

  • I'd like to be able to query user contribs in a similar way to querying page histories. Lupin 03:53, 4 May 2006 (UTC)
Done. --Yurik 05:47, 10 June 2006 (UTC)

[edit] Multiple revisions of same article

I want just that. To be able to fetch two versions of the same article with arbitrary revision ids. joshbuddytalk 07:29, 10 June 2006 (UTC)

Done. You can now request any number (rvlimit) of unique users who edited given page(s). The revisions returned will be the last ones made by the users. --Yurik 23:18, 10 June 2006 (UTC)

[edit] History by revid

An oft-requested feature for my popups script is for it to provide better edit summaries when reverting. The script only knows about revision ids, so to do this it would be very useful if the revisions query supported using revids where it currently only dates, in the rvstart and rvend parameters. Lupin|talk|popups 12:56, 10 May 2006 (UTC)

What kind of request do you want to make - Get name,date,comment for title/pageId where revision id = x? If that is what you need, do you want x to be just one value or multiple revIds? So the query can become: give me a list of titles with revisions if all i know is a list of revIDs. This way you can specify a list of revisions, and get back which pages they apply to, and some revision info. --Yurik 05:11, 12 May 2006 (UTC)
For the immediate task at hand, I only need one or two revids. However, it'd be great if I could also specify ranges of the form "current until X", "X onwards", "X with previous 4 edits and next 5 edits". A general input syntax that springs to mind might be something like revids=x|y|a,b|c+1,d|^,e|f,$|g-2,h+4 which would retrieve the revision ids x,y, those between the one after c and d (inclusive), all those up to and including e (if that's not too many), all those from f onwards, and those between g and h with 2 more before and 4 more afterwards. Lupin|talk|popups 13:03, 12 May 2006 (UTC)
First part done - you can now request pages by revids. Currently it will not do any additional set processing such as +4, -2, etc, as I am not sure how it will be used. Postponing for now. --Yurik 03:35, 11 June 2006 (UTC)
Excellent, many thanks. I note that what=revisions&revids=1384&rvlimit=2 returns revision 1384 and the previous edit to that page. I hope this is a feature and not a bug, because it should be very useful. Lupin|talk|popups 04:23, 11 June 2006 (UTC)
Feature, albeit a bit unexpected in its use :). When revids are given, it first determines which pages they belong to, and add those pages to the output. Also, the rvlimit is defaulted to 0, so as to avoid any unexpected revisions in the result. Setting it manualy is still allowed, as i follow the policy of let the user burry themselves if they wish - i'm in the showels business. All other rv* params should work as well - again, might produce unexpected or confusing results. The query you showed would give top 2 revisions + the one you asked by its id. If the one you asked for is in the top 2, only 2 rows will be returned. --Yurik 08:24, 11 June 2006 (UTC)
Oh rats. I thought I was getting the revision I specified and the previous one, but that's not what you described. I must have tested this only on recent revision ids. Lupin|talk|popups 23:06, 11 June 2006 (UTC)

[edit] Image information and upload history

From IRC:

Duesentrieb> can query.php give me the file upload history?
select * from oldimage where oi_name = 'foo' order by oi_timestamp;
select * from image where img_name = 'foo';
--Yurik 18:45, 2 June 2006 (UTC)

Done. --Yurik 02:16, 14 June 2006 (UTC)


[edit] Retrieve "On-Top" Contribs

It would be really nice to be able to query "usercontribs" for only on-top edits, or to at least have usercontribs indicate which of the edits are currently on-top. I'd really like to use query.php for VP's contribs queries, as I think it would be a million times faster and query.php provides the data in such and easily readable format (other than scraping for oldids in links and such), and it would be much appreciated if this could be done. AmiDaniel (talk) 08:46, 20 June 2006 (UTC)

Done. What is the issue with the oldids? --Yurik 19:21, 24 June 2006 (UTC)

[edit] backreference limits

Moved from yurik's discussion page
hi!

why is there an backlink limit of 50? i think this makes it really much more traffic intensive (and a more difficult and long code) than simply calling "[1]". any way to shut down that limit?

greets, marco (HardDisk 16:28, 23 June 2006 (UTC))

Good point. Limits were placed a bit haphazardly, just to limit the most blatant abuse. I will need to revise them. --Yurik 13:57, 23 June 2006 (UTC)
thanks in advance! HardDisk 16:28, 23 June 2006 (UTC)
Done. --Yurik 19:21, 24 June 2006 (UTC)

[edit] Redirects (backlinks)

Another, much lower priority request, would be the ability to set "blfilter" for the "backlinks" query to redirects only. Also, if there would be a way to implement namespace filtering for backlinks, I would love you to death :). AmiDaniel (talk) 08:46, 20 June 2006 (UTC)

Done. Start loving on both counts. --Yurik 20:49, 24 June 2006 (UTC)

[edit] imageinfo for commons images

Could imageinfo be made to work for commons images? It'd also be nice if there was a flag in the output indicating whether an image was a commons image (and perhaps even if there is a commons image available with the same name, if not). I have a feeling that this is a duplicate feature request, so apologies if this is the case. Lupin|talk|popups 19:39, 3 July 2006 (UTC)

Done in a slightly different way - you may add iishared parameter which will tell you if images with the same names exist in the shared repository (commons), together with history. If both local and shared image info is present, local will always take precedence in wiki, but information about both will be returned. --Yurik 05:24, 25 July 2006 (UTC)
Thanks, this is very nice! Unfortunately, it seems to fail if the image only exists on the commons, such as Image:Green-eyed cat.jpg which gives [2]. I'd like to still get the shared image info in this case. Lupin|talk|popups 14:32, 25 July 2006 (UTC)
Weird bug - [3] returns the info you need, simply because there is another page that exists in local. Will fix it soon. --Yurik 15:03, 25 July 2006 (UTC)

One other thing: is it possible to retrieve the page content for commons image pages? Lupin|talk|popups 14:33, 25 July 2006 (UTC)

Yes, I can get any commons data, although i would be duplicating http://commons.wikimedia.org/w/query.php --Yurik 15:03, 25 July 2006 (UTC)
Indeed, but the problem is that javascript tools running on en.wikipedia.org can't access data on other hosts without arcane trickery. This is what lies behind the interwiki request, too. Lupin|talk|popups 16:20, 25 July 2006 (UTC)
Done. Use proxylang=xxx and/or proxysite=xxx to get alternative language and/or site. Commons is considered a language (figures...). The user always gets anon status on those. --Yurik 06:08, 26 July 2006 (UTC)

[edit] Subcategories

Would it be possible to list only the subcategories or only the articles of a category? Now these seem to be mixed. --HartzR 09:34, 5 July 2006 (UTC)

Done. --Yurik 00:15, 24 July 2006 (UTC)


[edit] Category downloading

I have found this strange behaviour: in order to download a category, one uses the "category next" tag as the cpfrom field to get the next chunk of the category; I have found that, if spaces are replaced with underscores in this tag (instead of %20), one gets most of the category, but misses some elements: In particular, there is exactly one missing element for each chunk (Liberatore, 2006). 20:26, 13 July 2006 (UTC)

cpfrom should be treated as an opaque, without any modifications. Please do not modify it, as its value may change at any moment. --Yurik 22:18, 13 July 2006 (UTC)
Makes perfectly sense. Thanks! (Liberatore, 2006). 10:42, 14 July 2006 (UTC)

[edit] Query user preferences

I'd like to be able to find out the logged in user's Date and time preferences. In particular, the time zone offset would be useful as it would let me generate a preview of history pages using local times. If possible, it'd be good to be able to query an arbitrary user preference value. Lupin|talk|popups 17:24, 16 July 2006 (UTC)

I haven't looked at the user preferences yet, but should not be too hard. See the next response re apt. :) --Yurik 14:37, 19 July 2006 (UTC)
Done. --Yurik 05:30, 24 July 2006 (UTC)

[edit] Category fields

Would it be possible to add cl_sortkey and cl_timestamp to the output of the category list? I think this would allow me to start up WP:PROD again on the toolserver (albeit with more caching, but it still might be valuable). --Interiot 04:48, 19 July 2006 (UTC)

Possible - the moment i get a few spare minutes. Finding an apartment in Manhattan is a full time job. --Yurik 14:36, 19 July 2006 (UTC)
Done. --Yurik 00:16, 24 July 2006 (UTC)
Wow, thanks! Does it take a little while for the change to go live? (and the change will appear under what=category, right?) --Interiot 05:44, 24 July 2006 (UTC)
Yep, should be available whenever shell people push it out. It is under category, correct. --Yurik 06:03, 24 July 2006 (UTC)

[edit] Possible normalization bug

http://cs.wikipedia.org/w/query.php?what=links&titles=Wikipedia:Disambiguation%20Templates should return the same result as http://cs.wikipedia.org/w/query.php?what=links&titles=Wikipedie:Disambiguation%20Templates . --Yurik 08:06, 25 July 2006 (UTC)

Resolved - It should have been http://cs.wikipedia.org/w/query.php?what=links&titles=Project:Disambiguation%20Templates --Yurik 15:11, 25 July 2006 (UTC)

[edit] Interwiki page content

I'd like to be able to retrieve page content for interwiki links. Lupin|talk|popups 14:35, 25 July 2006 (UTC)

Plese explain. --Yurik 15:09, 25 July 2006 (UTC)
For example, I'd like something like this: http://en.wikipedia.org/w/query.php?what=content&titles=Main%20Page&dbname=fr_wiki to return the main page from the French wikipedia. Lupin|talk|popups 16:17, 25 July 2006 (UTC)
Or better yet, http://en.wikipedia.org/w/query.php?what=content&titles=fr:Main%20Page Lupin|talk|popups 16:22, 25 July 2006 (UTC)
You can just use http://fr.wikipedia.org/w/query.php?what=content&titles=Main%20Page Martin 16:25, 25 July 2006 (UTC)
True, but this is inaccessible to a javascript tool running on en.wikipedia.org because of security restrictions. Lupin|talk|popups 16:43, 25 July 2006 (UTC)
Lupin, post this on the wiki email list - I am not sure we want to allow one site to communicate with another site. Even though commons resides on the same server, all sites are different, have different settings and language files. I cannot easily access that information, so I would have to make query api into a proxy to call another query api. I am not sure the servers allow outbound connections, or that one site waiting for another site would not kill the overall server performance. --Yurik 20:25, 25 July 2006 (UTC)
Done. Use proxylang=xxx and/or proxysite=xxx to get alternative language and/or site. The user always gets anon status on those. --Yurik 06:05, 26 July 2006 (UTC)