Skip to content

Instantly share code, notes, and snippets.

@skratchdot
Last active August 29, 2015 14:18
Open Search Format: youtube.com example

Links

Youtube Example

In <head /> of html:

<link rel="search" type="application/opensearchdescription+xml" href="http://www.youtube.com/opensearch?locale=en_US" title="YouTube Video Search">

In the .xml file that the <link /> tag links to:

<OpenSearchDescription>
  <ShortName>YouTube Video Search</ShortName>
  <Description>Search for videos on YouTube</Description>
  <Tags>youtube video</Tags>
  <Image height="16" width="16" type="image/vnd.microsoft.icon">http://www.youtube.com/favicon.ico</Image>
  <Url type="text/html" template="http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"/>
  <Query role="example" searchTerms="cat"/>
</OpenSearchDescription>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment