0

I am using url2png add-on on cloudinary CDN to capture an image of pages on my site. The code below will work when I try to capture an image on another site like can.com for instance. However, it will not work when I point it my own site.

What could be causing this? How do I get around it?

works:

image = Cloudinary::Uploader.explicit("http://www.cnn.com?unique=#{Time.now}/url2png/viewport=2200x680|unique=true",
                                  :type => "url2png")

doesn't work

image = Cloudinary::Uploader.explicit("localhost:3000?unique=#{Time.now}/url2png/viewport=2200x680|unique=true",
                                      :type => "url2png")

If I hit my staging url from dev it will also work.

EDIT

I'm now realizing that I am having this same experience on my staging server. So when I try to capture a page on my staging server from my staging server I get a 500 (timeout) but if I run the same code from localhost to staging it works. It feel like an origin issue or something. I'm not sure.

UPDATE

So I set up a subdomain on my staging server in hopes that I could hit sub.domain.com from www.domain.com and it would work... still doesn't work.

bonum_cete
  • 4,730
  • 6
  • 32
  • 56

1 Answers1

0

Cloudinary integrates with the url2png.com api to achieve the screenshot functionality. URL2PNG requires the page to be reachable from the internet.

You can use a tool like https://ngrok.com/ to make your localhost reachable from the internet.

See also: Access localhost from the internet

Community
  • 1
  • 1
danvine
  • 66
  • 2
  • 1
    Are you by chance running a single heroku dyno? Please be sure to reach out to Cloudinary support as well if you haven't already. – danvine Aug 03 '14 at 16:01