/lib/DDG/Spice/Octopart.pm

https://github.com/pardocz/zeroclickinfo-spice · Perl · 23 lines · 18 code · 5 blank · 0 comment · 1 complexity · e0b6b29532ec09d2f60747f0101d43fb MD5 · raw file

  1. package DDG::Spice::Octopart;
  2. use DDG::Spice;
  3. primary_example_queries "atmega datasheet";
  4. secondary_example_queries "ne555 specs";
  5. description "Searches parts from Octopart.";
  6. name "Octopart";
  7. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Octopart.pm";
  8. icon_url "/i/octopart.com.ico";
  9. topics "special_interest", "geek";
  10. category "special";
  11. attribution github => ['https://github.com/bnewbold', 'bnewbold'];
  12. triggers any => "datasheet", "specs", "octopart";
  13. spice to => 'http://octopart.com/api/v2/parts/search?apikey={{ENV{DDG_SPICE_OCTOPART_APIKEY}}}&limit=12&optimize.hide_offers=1&optimize.hide_specs=1&q=$1&callback={{callback}}';
  14. handle remainder => sub {
  15. return $_ if $_;
  16. return;
  17. };
  18. 1;