customizing facebook like informations displaying in profile facebook pages - php

I have to customize the elements displayed in the facebook personal page after publishing the like made to a post on a website.
I see that image, title and links are displayed but i have to display the post description too.
I've read, following some "Questions that may..." that i should use the Open Graph API but i would do the simplest solution ever to include the "description". If i could use the basic solutions offered by Facebook it would be a better solution.
Any suggestions?

You have to use the Open Graph API headers in the HTML page of your posts. E.g. in any post page from your website you have to add something like this in your HEAD section
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Site name" />
<meta property="og:title" content="Title" />
<meta property="og:description" content="Some description" />
<meta property="og:image" content="..." />

Related

Facebook og meta tags - scraper fetches nothing

So I have this cakephp project, when I share the link to facebook i don't get og:description, og:image etc, even though everything seems to be there.
My code: (Views/Layouts/default.ctp)
<head>
...
<meta property="og:url" content="<?=Configure::read('og_url');?>landing" />
<meta property="og:title" content="<?=Configure::read('app_title');?>" />
<meta property="og:description" content="<?=Configure::read('og_description');?>" />
<meta property="og:image" content="<?=Configure::read('og_image');?>" />
...
</head>
I initialize everything in bootsrap.php so all my files can have access to these values.
Which produces this, View Page Source:
<head>
...
<meta property="og:url" content="https://www.philippidescompetition.com/landing" />
<meta property="og:title" content="Back To School Spin & Win! " />
<meta property="og:description" content="Συμπλήρωσε τα στοιχεία σου και παίξε "Spin & Win"!" />
<meta property="og:image" content="https://www.philippidescompetition.com/img/wheel/og_image_s.jpg" />
...
</head>
So far so good, but when I share the link on facebook I don't get any of the meta data.
I tried the debugger tool, but it didn't really help.
I want to share philippidescompetition.com/landing this link, which redirects to the facebook app page or to the actual url philippidescompetition.com/users/register on my server, according to if its from a desktop or mobile, so am thinking this redirect causes the issue, but if I share philippidescompetition.com/users/register which doesn't have a redirect, all meta data are still empty
Any ideas?
You need to add an exception to your automatic redirect for the Facebook scraper.
It can be recognized by its User-Agent, see https://developers.facebook.com/docs/plugins/faqs#faq_1748179212062572

Share embed content on facebook using swf player

In order to share an Html content in facebook (witch may not be possible), i saw a trick using Open graph protocol and a SWF Player so the post will be treated as video post .
Exemple (link) :
<meta property="og:title" content="What anti agin method do you preffer?">
<meta property="og:image" content="https://mintsapp.io/uploads/polls/5639037a63bed.jpg" />
<meta property="og:url" content="https://mintsapp.io/poll/view/1395" />
<meta property="og:video" content="https://mintsapp.io/player/player.swf?id=1395&type=poll&token=567dcd401fb74&voteChoiceId=3172" />
<meta property="og:video:secure_url" content="https://mintsapp.io/player/player.swf?id=1395&type=poll&token=567dcd401fb74&voteChoiceId=3172" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video:width" content="472" />
<meta property="og:video:height" content="355" />
and when it comes to share this page on facebook , it will be treated like a video and an html content will be compiled using that SWL player , its actually load the html content and display it as flash content .
see this link : https://mintsapp.io/player/player.swf?id=1395&type=poll&token=567dcd401fb74&voteChoiceId=3172
I need to understand how to do something similar to that, because i've been googling the whole day with no results.
Thanks

Share website content on facebook

I design my website using html and php and MySQL , i use Open graph Meta tag to share my website on Facebook
<meta property="og:title" content="" />
<meta property="og:type" content="" />
<meta property="og:image" content="" />
<meta property="og:url" content="" />
<meta property="fb:admins" content="" />
I use this meta tag in all page like news and essay , my problem is for example i want to share one of website news on Facebook and i want share correct content , when i try to share , its share content i used in meta tag , i want share my news title, image and content..
my website work dynamically with MySQL and all of my website content like image and text saved in database .
My Question is how dynamically change share content of separate page using Open Graph Meta tag or another thing .
I don't understand what exacly you want from us.
This can vary depending on how your site script work.
You must set og meta content like how you show page content.
For example:
<meta property="og:title" content="<?=$page['title'];?>" />
<meta property="og:type" content="<?=$page['type'];?>" />
<meta property="og:image" content="<?=$page['image'];?>" />
<meta property="og:url" content="<?=$page['url'];?>" />
<meta property="fb:admins" content="<?=$page['admins'];?>" />

Facebook sharing: wrong sharing data when og:url used

I try to share some article at Facebook (without creating fb social app).
The header of file what I feed to https://www.facebook.com/sharer/sharer.php is following:
<meta property="og:type" content="article" />
<!meta property="og:url" content="url to some website" />
<meta property="og:title" content="Title" />
<meta property="og:image" content="url to image" />
<meta property="og:description" content="some description" />
The problem is - each time when i try to set og:url, title, image and description catches up from "url to some website" and suppress values that I typed explicitly here! Also og:type property changes from "article" to "website".
How can I fix this problem? Does I need to create fb social app for this?
I don"t know exactly what you want, but og:url basically ignores any other parameters you gave to the header.
You'd better check this :)
https://developers.facebook.com/docs/plugins/share-button

PHP, Zend, Facebook Share (Change the content)

How can I change the content of my facebook share option? my web app is written on PHP with Zend Framework. I want to change the content of the facebook share option instead of the description that was already been in the website.
If you use fb social plugin, it reads the open graph tags.
<meta property="og:title" content="title" />
<meta property="og:description" content="description" />
<meta property="og:image" content="thumbnail_image" />
You can set those in zend by using in controller
$this->view->headMeta()->setProperty('og:description','asdasdasd');
$this->view->headMeta()->setProperty('og:title',"title here");
$this->view->headMeta()->setProperty('og:image',"url");
if you dont want to use that open graph tags,
Creating Your Own Share URL
https://www.facebook.com/sharer/sharer.php?s=100&p[title]=titlehere&p[url]=http%3A%2F%2Fwww.yoururlhere.com&p[summary]=yours description
Open that URL in a browser, when user click share icon/link.
Btw, share is deprecated.
FYI: https://developers.facebook.com/docs/share/
FB Share description:
You can control the exact title, description, and thumbnail that Facebook Share uses by adding the following meta tags to the element in your page:
<meta property="og:title" content="title" />
<meta property="og:description" content="description" />
<meta property="og:image" content="thumbnail_image" />
please read more here:
regards.

Categories