PageRenderTime 78ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/YogaAsanas.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 33 lines | 25 code | 5 blank | 3 comment | 1 complexity | ca2dafaed8ea165e565af0d7b2c4b8bc MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::YogaAsanas;
  2. # ABSTRACT: Displays yoga asanas and sequences
  3. use strict;
  4. use utf8;
  5. use DDG::Spice;
  6. spice to => 'http://longtail.duckduckgo.com:8000/solr/prod/select?version=2.2&defType=edismax&qt=dismax&q=$1+source_match:yoga_asanas_api&fq=&wt=json&start=0&rows=75&sort=p_count+asc&json.wrf={{callback}}';
  7. triggers query_lc => qr{
  8. (?:\w+[]sanas?\b)|
  9. (?:\w+sahita\b)|
  10. (?:\bvinyasa\b)|
  11. (?:\w+pitham\b)|
  12. (?:samasthitih?)|
  13. (?:tplutih?)|
  14. (?:\b(?:postures?|poses?)\b)|
  15. (?:sun\s+salutation)|
  16. (?:s[]rya[\s-]+namask[]ra)|
  17. (?:(?:ashtanga|yoga)\s+(primary|intermediate|advanced)\s+series)|
  18. (?:yoga[\s-]+ch?ikits[])|
  19. (?:(?:standing|finishing)\s+(?:sequence|poses?|postures?))|
  20. (?:n[][ḍd]i[\s-]+[]h?odhana)|
  21. (?:sthira[\s-]+bhaga)
  22. }x;
  23. handle query => sub {
  24. # This makes sure "a" or "b", if specified, and the other query words
  25. # are associated with with either a practice or a posture, but not both
  26. return qq{"$_"~10} if $_;
  27. };
  28. 1;