propublica / politwoops_sunlight

Politwoops web front end
Other
44 stars 30 forks source link

Screenshot worker not getting Instagram links/images #23

Closed nickom closed 10 years ago

nickom commented 10 years ago

Not sure what's going on, but the screenshots are always blank.

Recent examples: http://politwoops.sunlightfoundation.com/tweet/455086185627811841 screen shot 2014-04-24 at 5 16 22 pm

http://politwoops.sunlightfoundation.com/tweet/454292134351601664 screen shot 2014-04-24 at 5 16 42 pm

http://politwoops.sunlightfoundation.com/tweet/459336163564982273 screen shot 2014-04-24 at 5 16 55 pm

nickom commented 10 years ago

Also true with Vine links: screen shot 2014-06-04 at 10 34 26 am

dvogel commented 10 years ago

The instagram problem relates to PhantomJS's support for newer versions of Javascript. Here's the error:

bin/phantomjs ../politwoops-tweet-collector/js/rasterize.js 'http://instagram.com/p/o05MWtKq5y/'
RenderDelayTimeout: 2000
TypeError: 'undefined' is not a function (evaluating 'RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/)')

  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:16
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:16
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/DesktopPPage.js:13
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/DesktopPPage.js:25
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/DesktopPPage.js:1
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1 in e
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/webpack-common.js:1
  http://d36xtkk24g8jdx.cloudfront.net/bluebar/acdcd6e/cache/bundles/DesktopPPage.js:25
Will render in 2 secs
Rendering failure for http://instagram.com/p/o05MWtKq5y/
Rendering failure for http://instagram.com/p/o05MWtKq5y/
Final rendering attempt failed.

We can fix it by using the Function.prototype.bind polyfill provided by Mozilla.

nickom commented 10 years ago

I understood "Here's the error" and "We can fix it"

So...good news?

dvogel commented 10 years ago

Future instagram images will work (fixed in 6e0da187148c6af392779e2ae725ef6849debb25).

Vine links are a different problem. I will create a separate ticket for that.

nickom commented 10 years ago

Yes yes yes yes yes. Thank you, you're the best @dvogel !