how to share animated gif on facebook - facebook

i'm going to create facebook app using javascript sdk.i want to create app which shroud be able to post animated gif .my idea arise after see this app and https://www.facebook.com/khalil.shr/app_212097992149339. it work 100 percent .
and another best example is https://www.facebook.com/photo.php?fbid=471334666225107&set=p.471334666225107&type=1 take a look this picture animated without clicking on it.i can't guess how it work ..i want a complete guide about that ..

There is no API which allows animated GIFs to be uploaded to Facebook - any you see on Facebook were uploaded while there was a bug in the image validation code and are only visible because the images were not retroactively removed

You can't upload an animated GIF to Facebook. There are however some ways to outsmart the system. For example, the 3 ways mentioned in Guide to Animated Gifs for Facebook. It says:
If you try to upload a GIF to Facebook, a still image of the first
frame will appear. However, there are three ways to try and outsmart
the system.
Make a Youtube video look like a GIF.
Use a third party app on Facebook like Animated Picture. For this app, you do not use your own files. There are hundreds
sorted out in different categories to choose from.
Post a link to the GIF. Yes, the still image will show up, but a description will accompany it. Yes, it may take more time, but
your friends will be curious as to what it entails.
But, if the GIF you want to upload is not a moving picture, it should
work just fine. If you have a GIF image that is a nonmoving image, you
should have no problem uploading it to Facebook. According to the
Facebook Developers page, GIFs are one of many file types allowed for
uploading to the platform. Other supported image file types include
JPG, PNG, PSD, TIFF, JP2, IFF, WBMP and XBM images.
Similarly, you can find many other workarounds to this on the internet.

there was a bug back in 2012 which allowed user to upload an animated .gif by renaming it to .jpg and then upload it as an image. This has been fixed , although you can still see the gifs that were uploaded before the fix.
NB: check uploaded date of all animated images in facebook, all of them are uploaded on or before year 2012

Looks like Facebook finally enabled the GIF support!
You can upload gif image to some 3rd party website (Gipfy or something else) and then upload this link to facebook - then it'll be displayed as animated GIF!
http://techcrunch.com/2015/05/29/facebook-confirms-it-will-officially-support-gifs/#.pfn8nn:CJC4

It is possible to publish a GIF through the Graph API, please see an example call below:
curl \
-X POST \
"https://graph-video.facebook.com/v2.8/{page-id}/videos" \
-F "access_token=<sanitized>" \
-F "source=fluffy_cat.gif" \

You can now post an animated Gif on facebook by posting it as a video. If you post it as a photo it will not be animate-able and will display the first frame only.
To post an animated gif from URL use this Graph API call:
POST /me/videos
access_token=<access token with "publish_actions" permission>
file_url=<url to file>
Alternatively you can replace me with another user or page identifier.

The best way to share an animated gif on Facebook, is to
Upload the GIF to an image hosting site that allows animated gifs, such as http://imgur.com or http://photobucket.com then
Get the direct URL to the image from that site
Post the URL to the GIF on Facebook
Remove the image preview, as that will be a still image, and people won't realise its an animated gif if they see a still image preview. Add text to the image's description that it is an animated GIF, and that they need to click the link to see the animation.
Pro Tip: If you want to be able to view animated GIFs directly on Facebook, without having to click the GIF links as mentioned in the method above. You can use a browser extension such as FB Purity : http://fbpurity.com as it has an option called "View Animated Gifs". When this option is turned on, whenever the extension sees a link to an animated GIF on the Facebook site, it automatically converts it to a fully working and moving Animated GIF, so you don't even need to click the link to see the animation.

Another method is to convert the animated Gif into a video file then upload that, as Facebook now autoplays Video files, just like animated gifs. One way to convert an animated GIF to a video file is to use the free, open source Virtual Dub software. Get Virtual Dub here http://www.virtualdub.org
Open your .gif as a video file in Virtual Dub... then save as .avi then upload the new file to Facebook.
Though you can search google for other methods of converting animated gifs to video files if you dont want to use Virtual Dub.
There are also some other alternative methods listed here:
https://superuser.com/questions/5730/how-do-i-convert-an-animated-gif-to-a-youtube-friendly-video-format

If you want to do it from your own site you must have verified (green lock icon)secure layer socket SSL installed certificates. Then just go to Facebook debug and add the link. EASY!

Related

Comment a facebook post with an image/picture via API

I would like to be able to reply/comment a facebook post with an image using API.
If I'm able to achieve that with python it would be fantastic, but also other languages would be ok.
Using an image url or a local stored image makes no difference.
Another option that would fit for me is to use a GIF.
I noticed that if I insert a giphy.com GIF link, the GIF is showed correctly, but the URL is visible and I would like to make it invisible.
Any solution to achieve any of the two?
Thanks

Facebook API. Change video thumbnail?

When you upload a video to facebook, it lets you specify a thumbnail you want to use out of the 10 it generates and offers you (In the edit settings). Is there a way to upload a video and have it change the thumbnail to one of their randomly generated thumbnails using the api instead of having to do it manually?
There is no way to directly tell Facebook to select one of those default thumbnails.
You can query the [api_url]/v2.3/[video_id]/thumbnails edge which gives you the 10 thumbnails that Facebook has extracted from the video, and then set one of those as the video thumb using the same edge yourself.
Refer to: https://developers.facebook.com/docs/graph-api/reference/video/thumbnails/

Unity facebook SDK, can not post picture with FB.Feed

In my Unity IOS game, I am unsuccessfully trying to use FB.Feed to share a screenshot on the user's wall.
Facebook documentation uses FB.Api to publish the screenshot, but this method does not display a share dialog, it simply uploads the pic to Facebook.
Answers I have found so far:
Upload the picture using FB.Api, and then parse the FBResult for the picture URL, and feed that to FB.Feed Link to answer.
This method triggers an error, since it is not possible to use a Facebook URL as source for a picture.
Save the picture locally and prepend "File://" to the picture path. Link to question. This does not seem to work either, and the Facebook documentation does not seem to have any information on URL formatting.
My question:
Is this the correct (and only) way to display a share dialog when publishing a picture? Or am I looking in the wrong direction?
FB.Feed only allows you to post link to images. It doesn't upload the images to Facebook. Therefore, these images need to hosted somewhere on the net and not locally.
The best way to make it work is either upload the images to FB (with privacy property set to EVERYONE) using FB.API, and then share the link to that picture via FB.Feed. If you don't want to create duplicate stories, i.e. one from posting the picture and another from FB.Feed, make sure that you set no_story to true.

why does facebook's thumbnail cache use wrong image and debugger shows correct image?

i have written a plugin for the elgg social networking platform which supports sharing links to other social networks.
mostly this is ok.
i am noticing though that facebook often shows incorrect images for the video thumbnails and other sites, such as google+ are ok.
the url i am passing in to the sharer page is correct and when i use the facebook debugging tool, i see the correct image - e.g. https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Fwww.infiniteeureka.com%2Fvideos%2Fwatch%2F6980%2Fwater-as-primary-healing-agent-dis-ease-is-commonly-due-to-dehydration
as an example - this is the url that the plugin currently outputs for facebook, when sharing a video on my site:
https://www.facebook.com/sharer/sharer.php?s=100&p[title]=water+as+primary+healing+agent+-+dis-ease+is+commonly+due+to+dehydration&p[summary]=description&p[url]=https://www.infiniteeureka.com/videos/watch/6980/water-as-primary-healing-agent-dis-ease-is-commonly-due-to-dehydration&p[images][0]=https%3A%2F%2Fwww.infiniteeureka.com%2Fmod%2Fvideolist%2Fthumbnail.php%3Fjoindate%3D1293022025%26guid%3D6980%26owner_guid%3D2%26size%3Dlarge
when i share this to facebook, i see a thumbnail for another video which i shared days earlier, which has a different url. (edit: i now notice that i can choose from 3 images in facebook and one of them is the correct one - so facebook is building an array of 2 incorrect images in some way and is defaulting to an incorrect one.)
anyone know?
I run into this problem often as well. Try to make your image around 1080px # 1080px and see if that helps. The other options is to try and lazy load all the other images so facebook doesn't pick them up as I presume the thumbnail you are referring to is on the page?

iPhone OS: Posting an image + text "story" to a user's news feed through the facebook api

So what I am trying to do is post an image that has been created by a user on an iphone into that users newsfeed.
The functionality I am having a hard time understanding if it is possible:
Can I pass a local NSURL (or URL?)(to a png file that lives in the documents folder) through a JSON string and onto Facebook?
i want to mimic the action of a user going to his/her facebook page, clicking into the textfield for their newsfeeld, uploading an image by clicking the "photos" icon and selecting an image from a local disk and uploading it. I would also like to add some text into the post optionally.
I'm just getting started with the Facebook api and it seems pretty tough right now, any help would be appreciated. code examples appreciated.
Thanks,
Nick
You'll need to use a third-party image host like YFrog or roll your own image host. Facebook requires that all media attachments (including photos) be hosted on the public web. Even though they cache the images themselves, the URL that you send to them has to have its own public URL. Many of the popular Twitter image hosts have simple REST APIs to achieve this.
You can also use Facebook itself to host the image via their photo.upload API, if you don't mind two side-effects: it will appear in the user's photo albums, and the thumbnail is likely to appear in the stream twice (once representing the addition to the photo album, and the second in the actual stream story you publish). You can't currently get around this doubling artifact, but it will give you a stable host for the uploaded image.
Just to clarify this. I was actually able to pass and image directly from the iPhone without a third party but that was posting an image to a users photo album. There are I think two methods in the fbconnect api for posting one contains an extra argument for a data argument which can be an image. I'll post more details when I'm in front of the documentation.