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

/lib/DDG/Spice/BitcoinBalance.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 35 lines | 23 code | 9 blank | 3 comment | 0 complexity | bad9a28bb35352e2db5130771be3304b MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::BitcoinBalance;
  2. # ABSTRACT: Displays the balance of a Bitcoin address from the Chain.com API.
  3. use strict;
  4. use DDG::Spice;
  5. primary_example_queries "17x23dNjXJLzGMev6R63uyRhMWP1VHawKc", "1Gn2dRFqouUHvuWPVhriCDtP3qVQc59WHy", "3QJmV3qfvL9SuYo34YihAf3sRCW3qSinyC";
  6. description "Display the balance of a Bitcoin address";
  7. name "Bitcoin Address Balance";
  8. source "http://chain.com";
  9. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/BitcoinBalance.pm";
  10. topics "economy_and_finance";
  11. category "finance";
  12. icon_url "https://chain.com/chain32x32.ico";
  13. attribution github => ['https://github.com/chain-engineering','chain.com'],
  14. email => ['hello@chain.com','chain.com'],
  15. twitter => ["chain", 'chain.com'],
  16. web => ['https://chain.com','chain.com'];
  17. triggers query_raw => qr/^[13][1-9A-HJ-NP-Za-km-z]{26,33}$/;
  18. # This regular expression identifies the unique properties of a Bitcoin Address.
  19. spice to => 'https://api.chain.com/v1/bitcoin/addresses/$1?key={{ENV{DDG_SPICE_BITCOIN_APIKEY}}}';
  20. # The Chain API requires an API key. Chain has granted the spice a free account with unlimited access. We can provide this to DuckDuckGo before release.
  21. spice wrap_jsonp_callback => 1;
  22. spice proxy_cache_valid => "418 1d";
  23. handle query_raw => sub {
  24. return $_;
  25. };
  26. 1;