PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/BitcoinBlock.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 36 lines | 25 code | 9 blank | 2 comment | 1 complexity | d72537d83c0da7d1ffd2582a8913d4e7 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::BitcoinBlock;
  2. # ABSTRACT: Displays information about a bitcoin block using the biteasy.com API.
  3. use strict;
  4. use DDG::Spice;
  5. primary_example_queries "000000000000000000935d5053d80266447a6cc180e488bbb85675ca61cddfe7",
  6. "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
  7. "000000000000000040cd080615718eb68f00a0138706e7afd4068f3e08d4ca20";
  8. description "Display information about a Bitcoin block";
  9. name "Bitcoin Block Info";
  10. source "https://api.biteasy.com";
  11. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/BitcoinBlock.pm";
  12. topics "economy_and_finance";
  13. category "finance";
  14. icon_url "https://www.biteasy.com/favicon.ico";
  15. attribution github => ['https://github.com/biteasy','biteasy.com'],
  16. email => ['support@biteasy.com','biteasy.com'],
  17. twitter => ["biteasy", 'biteasy.com'],
  18. web => ['https://biteasy.com','biteasy.com'];
  19. triggers query_raw => qr/^(?:bitcoin block|btc block)?\s*(0{8}[a-fA-F0-9]{56})$/;
  20. # This regular expression parses a valid bitcoin block
  21. spice to => 'https://api.biteasy.com/blockchain/v1/blocks/$1?api_key={{ENV{DDG_SPICE_BITEASY_APIKEY}}}';
  22. spice wrap_jsonp_callback => 1;
  23. handle query_raw => sub {
  24. return $1 if $1;
  25. return;
  26. };
  27. 1;