1

As part of a weekend project, I'm making a little website that draws on a (google) map based on user running tracks. I would like users to be able to upload a snapshot of the map using a facebook share button. The catch is, I would like to avoid hosting the images myself, to reduce bandwidth usage.

I can use html2canvas to turn a map into a canvas, and that into a .png using toDataURL(). The png would then be contained in a javascript variable in the user's browser, and not stored (or hosted) anywhere. So, with that in mind:

  1. Can anyone think of a way to make facebook scrap that image for the entry in the user's time line?
  2. Would facebook store the image permanently, or would it try to refresh it periodically (and fail)?

I understand that following the link in the post would also not go to the image (which doesn't exist), but less assume that's not an issue for now.

Any ideas or alternatives would be very welcome! Thanks!

Miquel
  • 15,405
  • 8
  • 54
  • 87

1 Answers1

1

According to How long is Facebook caching the sharing thumbnails?, facebook is caching share images for 3-5 years, so if you can get it in there..

perhaps you DO save the image and then delete it with a cron task that runs every minute?

* * * * * /home/me/scripts/deleteAllMyShareThumbs.sh
Community
  • 1
  • 1
Alien Life Form
  • 581
  • 1
  • 7
  • 15
  • Hmm.. thanks. Still, that means facebook considers it a site preview, and not an image the user shares, so to speak. I wouldn't like to go about breaking people's timelines... Well I suppose I could just keep the images stored (storage is cheap) as long as facebook doesn't download them too often. Thanks! – Miquel Jun 29 '14 at 20:47
  • 1
    Yeah, maybe if the caching is tight enough, you wouldn't see too much traffic. – Alien Life Form Jun 29 '14 at 20:49
  • Aha, imgur will offer free hosting of the images for non-commercial apps, provided it's not too heavy usage. That ought to do the trick. Thanks! – Miquel Jun 30 '14 at 08:06