PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/Octopart.pm

https://github.com/aembleton/zeroclickinfo-spice
Perl | 23 lines | 19 code | 4 blank | 0 comment | 1 complexity | 5f9d92dec50ce4f38ede4e78e8f2ff32 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. status "enabled";
  13. triggers any => "datasheet", "specs", "octopart";
  14. spice to => 'http://octopart.com/api/v2/parts/search?apikey={{ENV{DDG_SPICE_OCTOPART_APIKEY}}}&limit=3&optimize.hide_offers=1&optimize.hide_specs=1&q=$1&callback={{callback}}';
  15. handle remainder => sub {
  16. return $_ if $_;
  17. return;
  18. };
  19. 1;