We are trying to make Article Reader where Posting happens when user reads the Article.
The Problem we are facing is that the Article URLs are not publically available as we need to make sure the User reading the article should be logged into FB.
For instance, our Article URL is like SERVER_NAME/article/view/ARTICLE_SLUG.
Whenever any new user try to click on a post of this object, they are taken to permission page and once they allow, they are shown the article. But this Page is not scraped by facebook and hence it is not posted.
We have tried to create a Login independent URL like SERVER_NAME/article/ARTICLE_SLUG and in the og:url we set to SERVER_NAME/article/view/ARTICLE_SLUG thinking that when the posting happens it will show SERVER_NAME/article/view/ARTICLE_SLUG as the URL but its not happening.
Can someone suggest what should be the best way to do this.
When facebook scrapes your page they use a very specific user agent string:
You can read about it in the documentation for the Like Button under the "When does Facebook scrape my page?" section.
When you get a request check the user agent string in the request, if it matched the facebook scraper then allow the request and just return a simple html of just the meta and og tags.
Since facebook also caches the results, it’s not something that should happen more than once a day, as it says: