From 5b370eb422e0669fdf0cd492a27a03b1471bc15d Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Wed, 8 Jan 2014 11:30:50 -0800 Subject: [PATCH] /dev/api: Add uses_site to /api/info. You can specify the subreddit to clamp results to that subreddit. --- r2/r2/controllers/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 508589e48..dfc708eb7 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -145,7 +145,7 @@ class ApiController(RedditController, OAuth2ResourceController): @validate(link1 = VUrl(['url']), link2 = VByName('id'), count = VLimit('limit')) - @api_doc(api_section.links_and_comments) + @api_doc(api_section.links_and_comments, uses_site=True) def GET_info(self, link1, link2, count): """Get a link by fullname or a list of links by URL. @@ -155,6 +155,9 @@ class ApiController(RedditController, OAuth2ResourceController): If both `url` and `id` are provided, `id` will take precedence. + If a subreddit is provided, only links in that subreddit will be + returned. + """ c.update_last_visit = False