I've successfully embedded Google Static Maps in an RSS feed that I'm working on, and it displays great in standalone feed readers. Unfortunately, if someone tries to subscribe to my feed using a web-based reader/aggregator (such as Google Reader), my images don't show up. Presumably, the referer of the aggregator website is sent to maps.google.com, which rejects the request as not matching my API key.
Is there some trick I can use to make this work? Here are the options I can imagine:
- Have the feed pull images from geohash.info, which in turn downloads the real image file and caches it
- Again, have the images come from geohash.info, but this time have the page act as a non-caching proxy for maps.google.com (but setting a far-future expiration)
- Trick the browser into sending geohash.info as a referer
- Serve a different version of the feed to aggregator bots (based on their referer), using their API key (I don't know how I'd get that)
- Have the image URLs point to a page at geohash.info that grabs the API key for the referer, and redirects to the maps.google.com URL using that API key (again, probably not an option)
Update a few hours later: That last approach worked! I found a way to look up the API key for any site, so now I can embed key-less static maps, like this: