PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/Arxiv.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 21 lines | 12 code | 8 blank | 1 comment | 0 complexity | dec796cd67201656c7eb9913e88839e3 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::Arxiv;
  2. # ABSTRACT: Retrieve articles from arxiv.org by identifier
  3. use DDG::Spice;
  4. spice is_cached => 1;
  5. spice proxy_cache_valid => "200 7d";
  6. spice wrap_jsonp_callback => 1;
  7. spice to => 'https://duckduckgo.com/x.js?u=http://export.arxiv.org/api/query?id_list=$1';
  8. triggers start => 'arxiv';
  9. handle query_lc => sub {
  10. return unless m/^arxiv[:\s]+?([^\s]+)/;
  11. return $1;
  12. };
  13. 1;