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

/lib/DDG/Spice/BitcoinTransaction.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 38 lines | 26 code | 10 blank | 2 comment | 1 complexity | 22103ef6d764305bd68d5d2ca15118d4 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::BitcoinTransaction;
  2. # ABSTRACT: Displays information about a bitcoin transaction using the biteasy.com API.
  3. use strict;
  4. use DDG::Spice;
  5. primary_example_queries "0e40627940d835d7154dcce33d6755f7ec40c7cc9e88d86291a971567bcd7ea7",
  6. "b1956e97661f91ab020f97dff96b8043602dcbdc23d0825f790b521221bef1f5",
  7. "b6f952bcb5e0f2da3726f7ecc1101afcc18248229ea57abcca7e2542f323ae7d";
  8. description "Display information about a Bitcoin Transaction";
  9. name "Bitcoin Transaction Info";
  10. source "https://api.biteasy.com";
  11. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/BitcoinTransaction.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 transaction|btc transaction)?\s*([a-fA-F0-9]{64})$/;
  20. # This regular expression parses a valid bitcoin block
  21. spice to => 'https://api.biteasy.com/blockchain/v1/transactions/$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;