richard icon indicating copy to clipboard operation
richard copied to clipboard

Implement search in the API

Open squiddy opened this issue 13 years ago • 0 comments

There is a special view in the code that, given a source_url, returns a link to the video with that source: https://github.com/willkg/richard/blob/master/apps/videos/views.py#L102

We should integrate that functionality into the new tastypie-driven API.

  • Do we want to extend the functionality? Arbitrary searches with haystack or restricted to specific fields (e.g. source_url)?
  • I think it would be useful if we include a link to the video on the page with every video resource response. Should be easy to do with dehydrate.

Example response from GET http://example.com/api/v1/video/search/?source_url=youtube.com/v/4dfr4t

{
// default fields from model
 "added": "2012-03-12T20:30:17", 
 "category": "/api/v1/category/17/",
 ...
// additional data
 "page_url": "www.http://pyvideo.org/video/691/1-psf-sprints-supporting-the-community"
}

Search might return multiple values though.

squiddy avatar Apr 20 '12 17:04 squiddy