PageRenderTime 132ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/SimilarSites.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 32 lines | 22 code | 8 blank | 2 comment | 2 complexity | cb040e43bdcda09d26e77eb4612643d8 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::SimilarSites;
  2. # ABSTRACT: Find sites that are similar to a given site
  3. use DDG::Spice;
  4. primary_example_queries "similar sites to facebook.com", "similar to youtube.com";
  5. secondary_example_queries "sites like twitter.com", "pages like github.com";
  6. description "Search for similar websites";
  7. name "SimilarSites search";
  8. source "SimilarSites";
  9. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/SimilarWeb.pm";
  10. icon_url "/i/www.similarsitesearch.com.ico";
  11. category "entertainment";
  12. topics "everyday", "special_interest";
  13. attribution github => ['https://github.com/Adman', 'Adman'],
  14. twitter => ['http://twitter.com/adman_X', 'adman_X'];
  15. triggers startend => "similar sites", "similar sites to", "similar web to", "sites like", "websites like", "webs like", "pages like";
  16. spice to => 'http://www.similarsitesearch.com/api/similar/$1';
  17. spice wrap_jsonp_callback => 1;
  18. handle remainder => sub {
  19. s/^https?:\/\///;
  20. # remove whitespace
  21. s/^\s+|\s+$//g;
  22. return $_ if $_;
  23. };
  24. 1;