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