Is there a way to set the dimensions of a swf posted to Facebook using the feed dialog, either javascript or direct url method?
https://developers.facebook.com/docs/reference/dialogs/feed/
I'm not 100% certain that this works anymore as I've tried to add this with the Feed dialog as opposed to the sharer and it seemed to have no effect at all. It may have been replaced by the source parameter in the newer feed dialog API (which I don't think you can define a width/height for. Please correct me if I'm wrong) ..
but,
take a look at media attachments in the stream attachment guide:
https://developers.facebook.com/docs/guides/attachments/
you would pass in a JSON encoded object as the media URL param.
{"media": [{
"type": "flash",
"swfsrc": "http://www.mapsofwar.com/photos/EMPIRE17.swf",
"imgsrc": "http://icanhascheezburger.files.wordpress.com/2009/04/funny-pictures-hairless-cat-phones-home.jpg",
"width": "80",
"height": "60",
"expanded_width": "160",
"expanded_height": "120"
}]}
Related
I had to restore a php page from an old version and now facebook debugging is not finding the og:image tag any more.
A share url is: https://maltishlanguage.com/dictionary/0603/
If I share debug the link on the LinkedIn post inspector, the og:image is shown correctly.
in the tag, I have an og:image (http jpg URL) and a og:image:secure (https jpeg URL)
The Graph API Explorer gives a good image:
{
"url": "https://maltishlanguage.com/dictionary/0523/rude/1?s=s",
"type": "website",
"title": "Maltish - I am turning round in the nothing",
"image": [
{
"url": "http://maltishlanguage.com/images/fbMaltishLanguageDictionary.jpg"
}
],
"description": "Maltish Dictionary entry from the Expression 'Qed indur fix-xejn '",
"updated_time": "2022-07-21T05:24:04+0000"
}
#Cbroe solved the issue for me, many thanks and sorry i did not understand you initially, but I just checked by setting Google into cookieless mode which showed the error where I had a session check, but in the else I was still tryiong toe read the session if not set and it was thoring the error #CBroe mentioned!
Solved and it's working now :)
So issue was that a PHP error was being written to the outpu HTML in the HEAD tag.
I am trying to update a client's code which pulled user's images from Facebook graph API.
I would like to pull the all the items from '/me/feed' if possible, but reading the SDK docs it looks like the feed is separate from the photos now.
The original client used v2.2 and would return a property images containing an array of images that were tied to the post.
"images": [
{
"height": 960,
"source": "https://scontent.xx...",
"width": 720
},
{
"height": 800,
"source": "https://scontent.xx...",
"width": 600
},
...
]
With v2.6 it seems the most I can get is a cover photo using full_picture as a field. '/me/feed?fields=id,message,full_picture,created_time' but this neglects the four other images on the post. There is a separate photos edge but it doesn't appear to have any way to just get the images for a specific post.
I would appreciate any suggestions on how to go about getting all feed items and their corresponding images. Thank you.
You can get the same images by doing another query on the object_id. NOTE: This is different then the actual id, which is what I was searching on before
From /me/feed?fields=id,object_id
From /{object_id}?fields=images
My app needs to get data facebook scrapes from URLs. Up until now we were getting it using
POST /?id={object-instance-id or object-url}&scrape=true
Which is detailed in updating object section in https://developers.facebook.com/docs/sharing/opengraph/using-objects
For example
POST /?id=http://google.com
{
"url": "http://www.google.com/",
"type": "website",
"title": "Google",
"image": [
{
"url": "http://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png"
}
],
"description": "Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.",
"updated_time": "2015-10-06T11:34:58+0000",
"id": "381702034999"
}
Notice image section.
Unfortunately if og tags are configured wrongly on the server
POST /?id=http://some.page.with.bad.tags.com
{
"error": {
"message": "Invalid parameter",
"type": "FacebookApiException",
"code": 100,
"error_subcode": 1611016,
"is_transient": false,
"error_user_title": "Object Invalid Value",
"error_user_msg": "Object at URL 'http://some.page.with.bad.tags' of type '' is invalid because the given value '/some-bad-value' for property 'og:url' could not be parsed as type 'url'.",
"fbtrace_id": "abcabcabc"
}
}
Which returns nothing interesting.
Attempt to GET the url returns this:
{
"og_object": {
"id": "381702034999",
"description": "Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.",
"title": "Google",
"type": "website",
"updated_time": "2015-10-06T11:40:04+0000",
"url": "http://www.google.com/"
},
"share": {
"comment_count": 2,
"share_count": 13494003
},
"id": "http://www.google.com"
}
Which misses image section. I cannot find in the documentation any way to retrieve result with images without using POST /?id={url}, but that fails on any errors in og tags.
GET /{ObjectId}
returns only type and created_time
Entering the same broken link in https://developers.facebook.com/tools/debug/ results in page which contains image, description, title and captions for the page. Which I need. So it means facebook stores them, even though page has wrong tags, but I need a way to fetch them. Unfortunatelly I cannot provide link for broken url due to NDA, and I couldn't find other page with broken tags.
If the page contains invalid Open Graph markup this seems expected, also do not confuse the Graph API with some sort of datasource or a scraping service you can utilize to generate the preview for web content.
If Facebook , for whatever reason, can't parse the Open Graph tags of a URL it will try to make a good guess based on the content of the page (large junks of text, images it finds, title tags etc.) to build the preview so you might get some sort of data back from GET /{object-id} which can just be a guess instead of actual og:.. data.
In case you really need a more or less failsafe solution, you could build your own scraper that looks for Open Graph tags.
I need to store the link to a file attached to a direct message (for a page, retrieved with "/conversations"). How can I do that?
I know how to get the link of an image. The JSON-object for an image ("attachments") contains the tag "image_data", which contains the tags "url" and "preview_url" for accessing the image.
For attached files (in my case e.g. a PDF), FB only sends "id", "mime_type", "name" and "size", but no additional data. Example:
"id": "m_id.158623824339344"
....
"attachments": {
"data": [
{
"id": "7b84fd4c0f18fb4060ae0fe0dcfeb42e",
"mime_type": "application/pdf",
"name": "Attachment1.pdf",
"size": 80798
}
]
}
But when I log into FB as a user and click the attachment in the browser, I get this link:
https://www.facebook.com/ajax/messaging/attachment.php?attach_id=<attach_id>&mid=id.<mid>&pageid=<pageid>&ext=<ext>&hash=AQCafpYeZj2pSjRk
By trial and error I found out that it is possible to access the file without the "hash" and "ext"-part. This means that in theory I am able to generate this link in my application ("attach_id" and "mid" are provided with the message and I know my pageid).
But this seems to be very unreliable. This link might change anytime, breaking my application.
I searched a lot but couldn't find any documentation about this. Does anybody know a better solution? Or can someone point me to some documentation regarding this issue?
Thanks a lot!
Barbara
Sorry this is not available as of v2.5.
If this becomes a new feature in the future, you should be able to find it in the documentation:
https://developers.intern.facebook.com/docs/graph-api/reference/v2.5/message/attachments
I'm trying to turn submitted Soundcloud links on my website into SoundCloud HTML5 players. I read that this is possible with oEmbed but haven't gotten it to work myself yet. What I know is that I should use the following oEmbed URL:
http://soundcloud.com/oembed?format=js&url=[escaped_url]&iframe=true
However, I have no idea what to do with it. When I have an escaped SoundCloud URL and replace it with [escaped_url], what's my next step? How do I exactly use that link to generate the SoundCloud HTML5 player?
Send a request to that URL, and the response will be a JSON file containing all the information you need to create the widget.
Here's an example:
$ curl http://soundcloud.com/oembed\?format\=js\&url\=https://soundcloud.com/spadgos\&iframe\=true
({
"version": 1.0,
"type": "rich",
"provider_name": "SoundCloud",
"provider_url": "http://soundcloud.com",
"height": 450,
"width": "100%",
"title": "nickf \u2603",
"description": "",
"thumbnail_url": "http://i1.sndcdn.com/avatars-000005187616-3e82aa-t500x500.jpg?b96a101",
"html": "\u003Ciframe width=\"100%\" height=\"450\" scrolling=\"no\" frameborder=\"no\" src=\"http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fusers%2F6431392\u0026show_artwork=true\"\u003E\u003C/iframe\u003E",
"author_name": "nickf \u2603",
"author_url": "http://soundcloud.com/spadgos"
});
Just grab the html property and stick that in your document and that should be it.