I am using the restfb Java api (from Scala) to post to Facebook. I have two questions.
i) If you put a link in the message field of a post, it will automatically be rendered as a link. But what if you want to include link text instead of the href in the post message? Including Dude gets rendered as a string. But clearly there are many examples of things like "Hey, check out this car , where car is a link. How do you do this?
ii) Facebook is including the description of my company in each post. I set the description field to the empty String and its still showing up. I even removed the description from the settings page for my Facebook app and its still showing up. Any ideas?
Thanks.
Instead of putting the link in the message parameter, you can put it in the link parameter of your HTTP POST to the Graph API. Otherwise, it cannot be done with an inline link that has text (like what you can do with normal href's).
I don't know of a way to remove a description meta tag once it's been set. Try just a period instead of an empty string to see if that works.
Related
I've successfully added a Share button to my website using the following code:
https://developers.facebook.com/docs/plugins/share-button
It produces a popup with a link to the og:url along with the title of the linked page and a picture from it, which I can then post, and it shows up on my Facebook.
I am having 3 issues with this:
I've update the og:url and data-href after page load, using jquery, but the new values get ignored when I Share.
the og:title, og:description, and og:image don't appear to be used at all.
Sometimes I'd like to Share some custom text (and images if possible) without any url.
I'm aware that Facebook provide other tools/APIs that provide more versatility but it seems that would mean my site would have to go through a review process, and I'd have to code for security. This is not an option and I want to stick to the popup method.
Hope someone can help. Many thanks.
If the tags do not change when posting, refresh (and test) the tags in the debugger: https://developers.facebook.com/tools/debug/sharing/
Dynamically created Open Graph tags (with JavaScript) will be ignored, the tags have to be in the original page source.
I write a blog but now nothing about programming.
Until some time ago, whenever I shared a new post on FB it chooses the first image of the post and that was fine (although I'd prefer to control which one to share every time). And it also got the title of the post correctly.
Now it always chooses the header picture of the blog and inserts the blog's title and description instead. Also, if I try to share the blog itself it chooses not the header picture but some old one from one given post...
FB debugger gives me this:
"og:image was not defined, could not be downloaded or was not big enough. Please define a chosen image using the og:image meta tag, and use an image that's at least 200x200px and is accessible from Facebook. Image 'http://1.bp.blogspot.com/-vVHBaAssg-E/VdiSUEICydI/AAAAAAAAApw/Tsmhu4ZefTk/s1600/dpca%2Bblog%2Bcover%2Bv3.png' will be used instead. Consult (...) for more troubleshooting tips.
To find the object, these are the redirects we had to follow"
But the pictures in the post (or the blog's header) are in fact larger than 200x200.
I've added code as suggested in FB and bloggers tutorials but still no juice...
What's wrong?
I'm using AddThis as the sharing "platform".
Example post: http://doportocomamor.blogspot.pt/2016/02/brincar-com-o-fogo.html
thanks a lot in advance
I'm creating a web app which uses Facebook feed dialog plugin in some pages. When I try to share these pages, the URLs posted to the news feed get truncated.
I'm using the direct URL approach. When the user wanna share something, she clicks in a link that is going to redirect her to the feed dialog. The link is composed as shown below:
https://www.facebook.com/dialog/feed?app_id=MY_APP_ID&link=SHARED_URL&redirect_uri=REDIRECT_URL
For example:
the URL I have in the "link":http://www.simplecity.com.br/DP/Index/?CID=0&UID=1
the URL I get in the news feed:http://www.simplecity.com.br/DP/Index/?CID=0
Has anyone already experienced this issue? Any suggestion?
The usual cause of this is forgetting to encode the link when you pass it into the Direct FB URL.
Are you forgetting to urlencode the link parameter (i'm especially thinking of the &) when creating the URL you're passing the user to?
I recently encountered the same problem with a straightforward link - I inserted:
https://example.com/page.html
into a page post. However, on the page it was rendered as:
https://example.com/page.ht...
as if the last two characters of the html extension were merely not displayed, as indicated by the elipsis. However, if you copy the link from the post you find that those chars are actually missing and the link resolves as 404. If you edit the post and reinsert the link, it is saved correctly, although the 'overflow' characters are still hidden by the elipsis. Very misleading.
What seems to work best is if you use the Facebook Developer OG tags in the page and then use Open Graph Debugger to scrape the link. This puts the URL in the FB realm and it picks up the correct link just fine. As you are doing this, the debugger tool gives you feedback to the effect: "This is the first time we have seen this URL"; which is baloney if you have put the URL on a FB page beforehand.
I have filed a bug report with Facebook; but I am not expecting them to own up to this bug.
I'm trying to get my application to post photos to a user's timeline using the user generated picture feature of Open Graph. Unfortunately, while I can easily get the picture to the user's timeline, I haven't found any documented way to pass along a caption.
Instagram seems to have figured it out: http://i.stack.imgur.com/TYsiX.png
Yet, if you go to the page of one of their posts, you'll notice that the caption isn't present in any of the Open Graph meta tags, so I'm guessing this is a value passed along with the POST.
Any suggestions?
There is an optional message attribute that you can pass to the action:
https://developers.facebook.com/docs/opengraph/define-actions/
Under optional arguments.
It takes special approval when you submit your action for approval
You should add "User Messages" Property in the followed image.
And then Give your caption in "message" tag.
I need to make a post to my facebook wall from my windows application. The post must have multiple links embeded within the post content. I can do it using Grap API but the problem is that I cannot specify an anchor text for links. The links themselves are very long so it's absolutly necessary for us to have an anchor text. But it seems facebook does not understand anchor text tags.
I know there is a "link" object but it's not an option because it allows only one "link" object per post.
Is there any way to post multiple links with an anchor text within a single post via Graph API?
Thank you
In short, no.
You can use a Link object, in which case you can supply a Message, Title, Description and Caption, but you can't actually hide the link, or display different text on your link - Facebook will always control how your hyperlinks work.
Other messages and Posts are plain text, so you can't use HTML formatting elements either.
It's all done to reduce the potentially hideous display of messages posted to Facebook, and to protect users from disingenuous link texts.
You can use Facebook Notes feature instead. Facebook Notes fully support HTML.
See this. How spotify have done this if formatting html elements are not allowed.
Facebook notes really support HTML. So yo can post links like this:
03131991saty