1

How can I test the 'Like' button functionality and OpenGraph data embedded in my pages while my site is not publicly accessible?

I have an internal test environment where my site is being built and tested. The environment is locked down by IP to a certain set of machines. I want to be able to verify the end-to-end scenario of performing a 'Like' and seeing the parsed OpenGraph data on a user's Timeline without having to open up my site to public access.

I know there's a user agent for the Facebook crawler, but allowing by user agent is risky as anyone can send any user agent string. Ideally, I'd like to lock it down to Facebook's crawler's IP range without having to parse logs to find what one or two of those IPs might be (I assume there's quite a few machines crawling the web for data).

My problem today is that I can click 'Like' and have it show up with a plain URL back to my site, but the crawler can't reach me since the page effectively doesn't exist for it when it hits my server.

Nick Tucker
  • 43
  • 2
  • 6
  • Here is a link to another SO question that might assist you - http://stackoverflow.com/questions/8859013/whats-the-ip-address-range-of-facebooks-open-graph-crawler – Lix Jan 16 '12 at 16:03

2 Answers2

1

This works fine with four social network previews: https://chrome.google.com/webstore/detail/open-graph-preview/ehaigphokkgebnmdiicabhjhddkaekgh?hl=es

It doesn't support the like button, just the preview.

enter image description here

From my localhost...as "proof of solution"

enter image description here

Kaos
  • 23
  • 1
  • 7
1

How can I test the 'Like' button functionality and OpenGraph data embedded in my pages while my site is not publicly accessible?

You really cannot do that. It has to be lint-able by Facebook. See: https://developers.facebook.com/tools/lint Be sure your page is publically avaible and able to be linted by the facebook linter tool.

DMCS
  • 31,720
  • 14
  • 71
  • 104
  • Thanks for responding! I didn't mark your answer as an accepted answer because it doesn't really solve my issue. Also, the answer cuts off mid-sentence, so I'm not sure where else you might've been going with it. I don't want to mark an answer as accepted if it doesn't resolve my issue, in case someone else comes across this later and does know of a way to do what I need to achieve. – Nick Tucker Mar 09 '12 at 06:12
  • It's been two months. Did linting the URL and fixing the issues it told you about fix the issue? – DMCS Mar 09 '12 at 15:14
  • I didn't have email notifications setup on my account, hence the late update :) My site is in a pre-production environment, so the linter will not work as-is; I opened this question to find solutions to testing Facebook integration in an environment that is not publicly accessible. – Nick Tucker Mar 09 '12 at 20:10
  • There you go. The URL **has to be accessible by the facebook linter** for this to work. – DMCS Mar 10 '12 at 17:34