PageRenderTime 29ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/BitcoinAddress.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 38 lines | 26 code | 10 blank | 2 comment | 1 complexity | c9b57aaae0fe60af866a5da2e8eae574 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::BitcoinAddress;
  2. # ABSTRACT: Displays information about a bitcoin block using the biteasy.com API.
  3. use strict;
  4. use DDG::Spice;
  5. primary_example_queries "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
  6. "1Biteasym3p5E4soZq8So6NjkjYugEnz2X",
  7. "1J6EZsQLTppftPTbqYbbRDYFJMW5Ex3Bqi";
  8. description "Display information about a Bitcoin Address";
  9. name "Bitcoin Address Info";
  10. source "https://api.biteasy.com";
  11. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/BitcoinAddress.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 address|btc address)?\s*([13][1-9A-HJ-NP-Za-km-z]{26,33})$/;
  20. # This regular expression parses a valid Bitcoin Address
  21. spice to => 'https://api.biteasy.com/blockchain/v1/addresses/$1?api_key={{ENV{DDG_SPICE_BITEASY_APIKEY}}}';
  22. spice wrap_jsonp_callback => 1;
  23. spice proxy_cache_valid => "418 1d";
  24. handle query_raw => sub {
  25. return $1 if $1;
  26. return;
  27. };
  28. 1;