Facebook Share &p[summary] Not Prefilling Summary on Share - php

I'm done with searching all places on the net, but I cannot find a solution to this. I have written the code for Facebook share to share a post on Facebook using the Facebook sharer code. The &u and &t parameters for it are working fine, but I am unable to change the description for the same. The &p[summary] doesn't seem to work. here's my code:
<a
rel="nofollow"
href="http://www.facebook.com/share.php?s=100&u=<?php echo curPageURL();?>&&t=<?php echo $title;?>&p[summary]=<?php echo $desc;?>"
class="fb_share_button"
onclick="return fbs_click()"
target="_blank"
style="text-decoration:none;"
>Share</a>

From what I can tell Facebook's old sharer.php posting mechanism isn't supported anymore by Facebook. The old documentation link https://developers.facebook.com/docs/share/ auto redirects to https://developers.facebook.com/docs/reference/dialogs/feed/.
You can though use the Facebook debugger: http://developers.facebook.com/tools/debug

You won't be able to do this with Sharer, but you might be able to do this with Share Dialog. The only formats you may use for Sharer are...
https://www.facebook.com/sharer/sharer.php?u={url}
https://www.facebook.com/sharer.php?u={url}
The top format is the only format indicated by the Official Facebook Share Button Documentation. To test this out, click "Get Code" at the Facebook Share Button Configurator, and look at the generated URL.
So, no, you may not indicate a summary. However, if you use Share Dialog, you might be able to do this. That's right! Facebook has two API's for sharing! Why? Sharer only allows sharing a URL, and it is secure without requiring an AppId or registering with Facebook. Share Dialog requires an AppId and registering with Facebook, so, you're allowed to set something like quote there. See other options: Facebook Official Share Dialog Documentation.
The developers have also publicly come forward and said that they will not support anything but u={url} in Sharer. To quote the blog post by Ibrahim Faour, Facebook Team, April 24, 2014...
We have changed the behavior of the sharer plugin to be consistent with other plugins and features on our platform.
The sharer will no longer accept custom parameters and facebook will pull the information that is being displayed in the preview the same way that it would appear on facebook as a post, from the url OG meta tags.

Related

What is the correct way to implement a facebook share button?

I'm trying to add a Share button to my website's various pages but I've found so many options I don't know which one is the most correct.
Official method:
https://developers.facebook.com/docs/plugins/share-button
I can't get this to work. If you'd like to check out a live example on my website pls comment :-) The share button appears, I click it, it opens but when I click 'share' again in the dialog, nothing happens. (the fb account is fine, I checked using other website's share buttons)
SO answer using share.php which I heard was no longer officialy supported:
facebook Sharer popup window
Finally the facebook share dialog (official):
https://developers.facebook.com/docs/sharing/reference/share-dialog
This method lists the use of 'app ID' which I'm having trouble with. It says to use a public ID and it IS required (not according to several SO questions), and I can't find how to do that.
Hence, I ask: What is one method that will surely work to implement normal share button (topic+image+small description) on my website?
Thank you.
I'd really need to see more of your implementation, but I have some thoughts.
As Facebook always requires the use of their Javascript SDK for their recent tools, you could check out that the SDK is loaded correctly.
Another thought: The SO answer with sharer.php seems a decent starting point. If you don't need everything to happen in a window/overlay, you can just create a simple link and point it to
https://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=Google&p%5Burl%5D=http%3A%2F%2Fwww.google.com
with p[title] as the page title and p[url] as the url of the page you want to share. This has been a reliable solution for me for years, as it doesn't rely on any Javascript and works in virtually all environments.
If you like you can always make the link open in a window via Javascript you can add yourself, so it's easy to debug.

Use facebook sharer.php to share on a page wall

I want to link a user to make a share post on my fb company page without having to authenticate. Currently I can get them to share on their own wall with:
But I'm not sure how I can get this to share to a page's wall rather than their timeline.
I got somewhat close by using the dialog feature:
https://www.facebook.com/dialog/feed?app_id=xxx&link=xxx&picture=xxx&name=xxx&caption=xxx&description=xxx&redirect_uri=xxx
But that just showed it as a normal share but done "via appName", unless there is a step I'm missing to link my app to my facebook page?
Thank you!
Unfortunately, the sharer.php method is used only to share only on the user's timeline.
If you want to ask the user to post on a page's timeline, you have to create an app, ask the user to authenticate it and then use the Facebook APIs to post on their behalf. I guess that will be cumbersome in your case, so I would just suggest you redirect to the particular Facebook page.
You can't !
To publish on YOUR page timeline, users need to have the rights to do it (be admin, writer, ...) : it's a manual requirement on the Facebook interface.

Tag friends to the link in facebook application

I have made an application on facebook, i have added link share option, comment for the link and like for the same link. Now what i want is the person who is generating the link can also tag his friends. Is it possible?
See my previous answer to this question Facebook Graph API Post with_tags option you need to specify a 'place' to do this as far as I'm aware
EDIT****
According to the developer blog, you can now use mention tagging which might be what you want
https://developers.facebook.com/docs/opengraph/mention_tagging/

Facebook api - PHP / Javascript and OpenGraph

I'm very confused so I hope that my question will make sense.
I'm working with the facebook API, and so far I've implemented login and a post to the users wall via php. I know read a bit more about the OpenGraph system, and the meta tags that you're supposed to put in your site, but I'm not quite grasping the concept og how to get my site fully PHP integrated with Facebook.
I have another login system which I've hooked facebook up to, so switching to javascript only will not be an option. Do the meta tags even matter if I use PHP only. I mean, I can't really get my head around how the token and all of that would be interpreted alongside the og: metatags if there is no javascript on the site.
Can I have BOTH php and javascript authentication? What's all that fuzz about opengraph anyway?
These are my thoughts about working with facebook, and if you'd like me to summarize this up in one question I guess it'd be:
How do I benefit from the opengraph meta tag features (tracking the users, in their timeline) when I'm only connected via PHP?
I'm confused about how the tags for specific open graph actions get interpreted like
<meta property="fb:app_id" content="xxxxxxxxxx" />
<meta property="og:type" content="myapp:read" />
and then it's supposed to post "MyName is reading lalala" or "MyName read lalala". How's the post to the server going on (if people have already authenticated via php):) ?
Unless I am misunderstanding your question, I think you are confusing how the Open Graph meta tags work. The meta tags provide external websites with exactly what they say: meta information, to be read by Facebook's "crawler". Facebook has their own web crawler that will grab certain relevant information about a webpage (for example, page title, page description, an image to associate with a webpage) so that Facebook can use that info when people "Like" or "Share" a webpage.
For example, going to https://www.facebook.com/sharer/sharer.php?u=http://example.com should illustrate how the crawler works: when someone tries to share the URL example.com on Facebook, Facebook's crawler goes to the example.com webpage and grabs relevant info, then displays it on their own page to allow you to share it with others.
The open graph tags have little or nothing to do with authenticating a user or application on Facebook's servers. They can be used totally independently of any login system that you have in place, as far as I know. All they do is provide meta information about a web page to Facebook's web crawler.
I understand your frustration with Facebook's API though - they are notoriously bad about keeping detailed, accurate information, and they change the API so frequently it's nearly impossible to keep up.
I can confirm that you're not the only one to be frustrated with the Facebook Documentation.
With that being said, i'll try to help you. As Sean said, the og graph tags have little or nothing to do with your authentication flow.
These are featured as information of what the user is doing at a certain time, like listening to a song, playing to one particular game, etc...
The Facebook's PHP SDK provides you functions to create your own objects and actions. Then you can call a $facebook->api(/...) function to indication to Facebook : My user is ACTIONS an OBJECT. Doing this, you must provide a parameter, which is the URL of the OBJECT on your Website/Application. In fact, Facebook wants you to tell him where he can finds what's this object. On a page where there's the correct meta-tags corresponding to this object ! Here are your og tags.
As you said, this will provide stories found in the timeline, or the ticker. It's those kind of things that Facebook Games use, "X is playing to Y", "Z earned the Grand Master title by playing on A", etc...
You must define those objects on your Facebook Applications Panel, and have the corresponding meta-tags on your website.
Then you just have to make the $facebook->api(/...) (or equivalent) request when this action happens on your website/application !
Everything is almost entirely explained in this tutorial : http://developers.facebook.com/docs/beta/opengraph/
Hope this will help you to find an answer.

Provide link/Redirect after a 'Like' or 'Share' on Facebook or a 'Share' on Twitter

basically what I want to do is forward people to a download link once they either 'like' my page on Facebook or post a link of the page to their profile (whatever is easier) and something similar for Twitter.
I have seen some bands do this when promoting a free download — to download the new song you must post this to your profile etc.
Anybody know how I could go about this? (This isn't a 'can you do it for me' question, I just need a point in the right direction regarding API's or any examples)
Thanks.
Look at the edge.create event in Facebook javascript SDK. This hits after you've liked something.
You can also create a Facebook app and check the likes of a Facebook user with their permission on the server side using FQL (user_likes).
You can create a Twitter app and read the last few tweets to check if there is a tweet containing your text/link/whatever programatically.
Notice that all of these can be deleted easily after you've redirected them. You cannot avoid that.
This Page has the like button attributes. Look under FAQ and you will see "How do I know when a user clicks a Like button?"

Categories