/[Frey]/trunk/lib/Frey/OpenSearch.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/OpenSearch.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 792 - (show annotations)
Wed Dec 10 15:15:22 2008 UTC (15 years, 4 months ago) by dpavlin
File size: 1171 byte(s)
Implement OpenSearch for Frey::Shell::Grep
1 package Frey::OpenSearch;
2 use Moose;
3
4 extends 'Frey';
5 with 'Frey::Web';
6 with 'Frey::File';
7
8 use MIME::Base64;
9
10 sub grep_as_markup {
11 my $self = shift;
12
13 warn "# url ", $self->dump( $self->request_url );
14
15 my $url = qq|http://localhost:3000/Frey::Shell::Grep/as_markup|; # FIXME don't hard-code URL
16 my $icon = encode_base64( $self->read_file( 'static/icons/Frey/Shell/Grep.png' ) );
17
18 $self->content_type( 'text/xml' );
19
20 qq|
21 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
22 xmlns:moz="http://www.mozilla.org/2006/browser/search/">
23 <ShortName>Frey::Shell::Grep</ShortName>
24 <Description>Find something with grep</Description>
25 <InputEncoding>UTF-8</InputEncoding>
26 <Image height="16" width="16">data:image/png;base64,$icon</Image>
27 <SearchForm>$url</SearchForm>
28 <Url type="text/html"
29 method="get"
30 template="$url">
31 <Param name="pattern" value="{searchTerms}"/>
32 </Url>
33 <!--
34 <Url type="application/x-suggestions+json" template="suggestionURL"/>
35 <moz:SearchForm>$url</moz:SearchForm>
36 -->
37 </OpenSearchDescription>
38 |;
39 }
40
41 =head1 SEE ALSO
42
43 L<http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox>
44
45 =cut
46
47 1;

  ViewVC Help
Powered by ViewVC 1.1.26