A few years ago, when learning Python, I wrote a little script that will retrieve and save to disk the current bing.com background image. The directory where the image is saved is the first argument. You can run it via cron if you use a Linux based OS or via Windows Task Scheduler if you use, well, Windows.

I did notice that if you access bing.com from a USA IP address then you have the ability to retrieve a higher resolution 1920x1200 image, whereas from the UK (and likely elsewhere) you can only access the 1366x768 image.

import re
import urllib2
import os
import shutil
import sys

bing_url = 'http://www.bing.com'
save_location = sys.argv[1]

p = re.compile('/az/.+?(jpg)')
resp = urllib2.urlopen(bing_url).read()

image_url = p.search(resp).group()
if '_EN-US' in image_url:
res = image_url.split('_')
extension = image_url.split('.')[-1]
image_url = '_'.join(res[:-1]) + '_1920x1200.' + extension

img = urllib2.urlopen(bing_url + image_url)
except urllib2.HTTPError as e:
print e

image_name = image_url.split('/')[-1]

if not os.path.exists(save_location):
with open(save_location + image_name, 'wb') as f:
shutil.copyfileobj(img, f)

Edit: I have since updated this script with some nice new changes. You can find that post here: https://ryanmcconville.com/blog/post/bing-image-retrieval-v2/

This was posted on Mon 23 Jun 2014 (4 years, 8 months ago) by Ryan McConville
July 17, 2017, 2:23 a.m. (1 year, 7 months ago)

It's posts like this that make surfing so much plrasuee