Posting images/emotions to Facebook status - facebook

I am trying to post images/emotions to a users status. Here is an app that does it: http://apps.facebook.com/status-emoticon/
I've viewed the JS source and I'm cofused, it seems to be sending some sort of code as a message and facebook is turning that code into an image.
Any ideas?

When you upload an image to FB you have to encode it in the body of your HTTP request. I did something like this recently when messing around with the API, check out this project:
https://github.com/abrady/gappengine/tree/master/fb06_canvas
It is a canvas that lets you grab photos from your friend's albums and upload them into an album of your choice. (in particular, look at the function graph_put_file in fb06_canvas.py)

Related

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.

Post object, status_type property doesn't work?

We're able to post to user's FB timeline/page as the page, no problem. The issue is the post that our app is posting is way smaller than post that a page/user can post to the feed manually.
We've tried to change status_type to one of mobile_status_update, created_note, added_photos, added_video, shared_story, created_group, created_event, wall_post, app_created_story, published_story, tagged_in_photo, approved_friend according to the API (https://developers.facebook.com/docs/reference/api/post/) but neither of these change how the post looks in the feed.
Has anyone been able to post content to timeline/page wall through an APP that looks as if it was posted manually - specifically size of the image?
Sample page post that was posted through our app as page owner - image is small:
Sample page post that was posted manually - large image. We'd like the one above to look like this as well when posted through the app:
status_type is set automatically. You can't set it yourself.
In the case of the manual post, you added a photo. To do that in the API, you have to query /PROFILE_ID/photos.
What you did through the API most probably is a post with a link, with the use of /PROFILE_ID/post with the link field filled. Hence, Daniel & Co shared a link.
That's why it doesn't look the same.
Some help for you to succeed at posting a photo:
How-To: Use the Graph API to Upload Photos to a user’s profile
Adding Photos to Stories
Disable grouping of photos on the timeline
Also note that you won't be able to post a photo with the link to image which is hosted on Facebook.

How can I download a video from Facebook using GraphAPI?

I want to download a video from facebook to the clients local drive. I saw a few browser plugins and Facebook apps that are able to that and I was wondering how it can be done using the GraphAPI or in any other way.
First, you get the Graph API object. If the object is public, it's simple, just get https://graph.facebook.com/10151651550011063. (Where the number is the object's ID, equal to the ?v=OBJECTID in the facebook video URL.)
If the object is not public, you need a valid access_token, and the Graph API url becomes something like https://graph.facebook.com/10151651550011063?access_token=DFSDSGSFDGFGDSblabla
Then, in the Graph API object, you'll find the video download link under source.
Refer Below Link. Might help you
http://developers.facebook.com/docs/reference/api/video/
1/ You can get source video by api but it only in sd quality.
2/ If you need to get source video by api, make sure you know to get accesstoken by this way:
Go to https://m.facebook.com/composer/ocelot/async_loader/?publisher=feed
Search for EAAA... it is your accesstoken.
3/ https://graph.facebook.com/v10.0/(page/group/userid)_videoid?fields=source&access_token=your_accesstoken
example https://graph.facebook.com/v10.0/1389311341281276_2668264723385925?fields=source&access_token=your_accesstoken
finally you can get private video or public video from facebook by graph api
$idPage/feed?fields=message,link,created_time,type,name,id,source
source => will return url mp4 video post
You cannot download videos using api.
You can just get there links,likes,comments etc.

How to post an image link to Facebook feed using graph API

I'm trying to post a picture to a feed using the graph API but this does not work if my image url does not have an image filename extension such as .png
(I have a URL to a png without the .png file extension as the image is created dynamically on the server)
This does seem to work when I manually post the link on my Facebook wall. Facebook wraps the URL like this:
http://external.ak.fbcdn.net/safe_image.php?d=AQAsdfyQsdfXvV5h59OP&w=90&h=90&url="my image url"
Does anyone know how I can post the URL of an image to the picture field of a feed post?
Facebook downloads and caches any image posted on the wall. It is then distributed on their CDN (content delivery network).
The reason is simple: load times. If someone posts an image from a slow server on FB, this could make experience of Facebook slow. So they copy all that.
So
maybe Facebook still has an old copy. Try with a fresh URL.
can facebook access the URL, or only your user?

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.