Advertisement
Guest User

Untitled

a guest
Aug 30th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import requests
  3.  
  4.  
  5. def main():
  6.     url = 'http://localhost:13331/'
  7.     body = {
  8.         'jsonrpc': '2.0',
  9.         'method': 'getfoundblocks',
  10.         'id': 'foo',
  11.         }
  12.     blocks = requests.post(url, json=body).json()
  13.  
  14.     for block in blocks['result']['hashes'][-5:]:
  15.         print(
  16.             '<a target="_blank" href="https://explorer.snowblossom.org/?search={}">{}</a>'
  17.             .format(block, block)
  18.             )
  19.  
  20.  
  21. if __name__ == '__main__':
  22.     main()
  23.  
  24.  
  25. # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement