def main():
    url = 'http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US'
    getHighRes = 1
    response = urlopen(url)
    try:
        output = response.readall().decode('utf-8')
    except:
        output = response.read()
    data = json.loads(output)
    output_url = ('http://www.bing.com/' + data['images'][0]['url'])
    output_url_highres = output_url.replace('1080', '1200')
    if (getHighRes == 1):
        try:
            process_url(output_url_highres)
        except:
            process_url(output_url)
    else:
        process_url(output_url)
def main():
    url = 'http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US'
    getHighRes = 1
    response = urlopen(url)
    try:
        output = response.readall().decode('utf-8')
    except:
        output = response.read()
    data = json.loads(output)
    output_url = ('http://www.bing.com/' + data['images'][0]['url'])
    output_url_highres = output_url.replace('1080', '1200')
    if (getHighRes == 1):
        try:
            process_url(output_url_highres)
        except:
            process_url(output_url)
    else:
        process_url(output_url)