lukehorvat / screenshot-tweet

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

Does not seem to work on the command line any more #9

Open snhrdt opened 5 years ago

snhrdt commented 5 years ago

I have a fresh install of the latest Node and NPM with only screenshot-tweet added:

$ node -v
v10.15.1
martin@node-0:~$ npm -v
6.4.1
martin@node-0:~$ screenshot-tweet --version
1.1.1

When I try to do a screenshot of a tweet, it does not report an error, but it also does not create the image file:

$ screenshot-tweet https://twitter.com/BarackObama/status/1095882980839616512 /tmp/tweet.jpg
Screenshotting tweet "https://twitter.com/BarackObama/status/1095882980839616512" to "/tmp/tweet.jpg"...
$ ls -l /tmp/tweet.jpg
ls: cannot access '/tmp/tweet.jpg': No such file or directory

Could you shed some light on this, please? Thanks!

0x15f commented 5 years ago

It doesn't seem to be working at all now. Any updates @lukehorvat

lukehorvat commented 5 years ago

Weird, it's working for me...

screenshot

@snhrdt Could it be a /tmp directory permissions thing? Try saving the screenshot somewhere else.

@0x15f Can you elaborate on that? What error message do you see?

dhjw commented 5 years ago

The issue for me appears to be when I run without an X display available. By running with DEBUG=* screenshot-tweet https://twitter.com/jack/status/1112459556972564482 x.jpg I got the error message electron child process exited with code 1: general error - you may need xvfb. On a desktop computer it worked once I did export DISPLAY=:0.0. For a headless server it looks like I need to figure out how to apply an xvfb wrapper, such as seen here.

drewrothstein commented 4 years ago

Re-wrote w/puppeteer and functional on OS X 10.15.4: https://github.com/lukehorvat/screenshot-tweet/pull/11.