Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. # encoding: utf-8
  2.  
  3. import sys
  4. import os
  5. import unittest
  6. import urllib2
  7. import json
  8. import socket
  9. from base64 import b64decode
  10. from pprint import pprint
  11. from workflow import Workflow, ICON_WEB, web
  12.  
  13.  
  14. def main(wf):
  15.  
  16.     url = 'https://api.bitcoinaverage.com/ticker/global/GBP/'
  17.     r = web.get(url)
  18.     r.raise_for_status()
  19.     j = r.json()
  20.     price = j["ask"]
  21.     networth = repr(price)
  22.     wf.add_item(title=networth,
  23.                 arg=networth,
  24.                 valid=True)
  25.     wf.send_feedback()
  26.  
  27. if __name__ == u"__main__":
  28.     wf = Workflow()
  29.     sys.exit(wf.run(main))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement