lukehorvat / screenshot-tweet

Screenshot a tweet.
MIT License
68 stars 6 forks source link

summary_large_image card not captured #4

Closed oli closed 6 years ago

oli commented 6 years ago

Thanks for this handy tool! When testing the example tweet via

screenshot-tweet https://twitter.com/reactjs/status/912712906407501825 tweet.jpg

I get a summary card as expected, but tweets containing summary_large_image don’t seem to get captured, instead leaving a blank spot. For example:

screenshot-tweet https://twitter.com/ciotan/status/929937601225670657 tweet2.jpg

…returns this image:

tweet2

Everything else works fine. If you have any idea what I’m doing wrong, please let me know. Thanks!

% screenshot-tweet -v
1.0.4
% node -v
v8.9.1
lukehorvat commented 6 years ago

I think the problem is that tweets like this contain a iframe, so sometimes the tweet is screenshotted before the iframe has a chance to load.

I've published a new version of the package (v1.0.5), which waits for the iframe to be visible before screenshotting. However there is a difference between a "visible" iframe and a "loaded" one, so it's possible that you may still encounter the problem. Let me know if it works for you.

oli commented 6 years ago

Success! ciotan

On the first attempt I got a placeholder box, but the second attempt worked. I had several other tweets that were similar, and these all worked first time. Thanks for solving this!

Closing as “Works for me” 👍