Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 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. def main(wf):
  14.     """JSON decoded correctly"""
  15.     url = 'https://api.bitcoinaverage.com/ticker/global/GBP/'
  16.     r = web.get(url)
  17.     r.raise_for_status()
  18.     data = r.json()
  19.     price = result['ask']
  20.     wf.add_item(title = price)
  21.     wf.send_feedback()
  22.    
  23. if __name__ == u"__main__":
  24.     wf = Workflow()
  25.     sys.exit(wf.run(main))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement