diff options
author | Yorhel <git@yorhel.nl> | 2021-01-10 12:29:52 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-01-10 12:29:52 +0100 |
commit | bc87360592b827abd454b3c2fc9697ceb66e0148 (patch) | |
tree | 12169043a46d1be8dc7a71e239a15b523eeb42e0 /lib/VNWeb/Misc | |
parent | a9812a77315b9d9a77f6be663bb46b0425e3b7bb (diff) |
v2rw: Convert /opensearch.xml description + ancient typo fix
Diffstat (limited to 'lib/VNWeb/Misc')
-rw-r--r-- | lib/VNWeb/Misc/OpenSearch.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/VNWeb/Misc/OpenSearch.pm b/lib/VNWeb/Misc/OpenSearch.pm new file mode 100644 index 00000000..1f74496b --- /dev/null +++ b/lib/VNWeb/Misc/OpenSearch.pm @@ -0,0 +1,22 @@ +package VNWeb::Misc::OpenSearch; + +use VNWeb::Prelude; +use TUWF::XML 'xml', 'tag'; + +TUWF::get qr{/opensearch\.xml}, sub { + my $h = tuwf->reqBaseURI; + tuwf->resHeader('Content-Type' => 'application/opensearchdescription+xml'); + xml; + tag 'OpenSearchDescription', xmlns => 'http://a9.com/-/spec/opensearch/1.1/', 'xmlns:moz' => 'http://www.mozilla.org/2006/browser/search/', sub { + tag 'ShortName', 'VNDB'; + tag 'LongName', 'VNDB.org Visual Vovel Search'; + tag 'Description', 'Search visual novels on VNDB.org'; + tag 'Image', width => 16, height => 16, type => 'image/x-icon', "$h/favicon.ico"; + tag 'Url', type => 'text/html', method => 'get', template => "$h/v?q={searchTerms}", undef; + tag 'Url', type => 'application/opensearchdescription+xml', rel => 'self', template => "$h/opensearch.xml", undef; + tag 'Query', role => 'example', searchTerms => 'Tsukihime', undef; + tag 'moz:SearchForm', "$h/v"; + } +}; + +1; |