Dogecoin coin Ticker ($1USD)

Displays current Dogecoin price for £1 from cryptonator

Image preview of Dogecoin coin Ticker ($1USD) plugin.

doge-gbp.py

Edit
Open on GitHub
#!/usr/bin/env python3

# <xbar.title>Dogecoin coin Ticker ($1USD)</xbar.title>
# <xbar.version>v1.2</xbar.version>
# <xbar.author>impshum</xbar.author>
# <xbar.author.github>impshum</xbar.author.github>
# <xbar.desc>Displays current Dogecoin price for £1 from cryptonator</xbar.desc>
# <xbar.image>http://i.imgur.com/FBUh3fk.jpg</xbar.image>
#
# by impshum

from urllib.request import urlopen

def main():
    result = urlopen('https://www.cryptonator.com/api/ticker/gbp-doge').read()

    if result['ticker']['change'] > '0':
        print((' Ð%.0f | image=iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAyQACAALwzISXAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AQHACkSBTjB+AAAALNJREFUOMvVk70NAjEMhb87WYiGBZAQU7ABNSVSWpZgEEagsJDoKBELUCEKFuBuCKTw0xyQC0lICe5i+/k9/wT+3opUUJQhcAUqa8I5ZQT4tANwioGTCkQZA9vmOQE2oUJFhL0DXBz33RpKUfCLfLTQJMx9IlEWuQr6QB3prGtNS1lwiMvEYo7ekNsKRBkB+y+rH1hDFVOwy7ids+gbVzrsM6CXeYDTF85xroB1ZoHb73ymB5RhJkpZTihGAAAAAElFTkSuQmCC color=#000000' %
              float(result['ticker']['price'])))
    else:
        print((' Ð%.0f | image=iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QABACnAADQ9FZaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AQHACQ1FZwK3gAAAMRJREFUOMvNkjEKAjEQRZ+jKNjYKh5AbzCdjVcQj+BFPIKlp7EMeAJrUbASQVCEr80uG9cNbqe/Cgn/5WUI/DqNfBHM+kCzbs+lPUAr2pwBq5qABbB+M8gszkDvS/kOdAG5VBgEM4ApsP0CGLukjxlEoA0wSZR3Lo0qhxhZDIBDAmDA0wsBLD51CZeOwLKivHbprZx6AkAHuEXbD5fawYwywMqAzOKeDTTPvKqcTGZBMLsGs0utn5gADYEHcKp9e9ni//MCDtNCE3qjsIwAAAAASUVORK5CYII= color=#000000' %
              float(result['ticker']['price'])))


if __name__ == '__main__':
    main()