Tag a video uploaded to Facebook? - php

I am working on a Facebook app that uploads a video to your Facebook Timeline. I would like to be able to tag the user's friends in the video, since I am processing the video to include their profile pictures. There are never more than 4 friends, and they appear in the video, so that shouldn't be violating any spam rules.
Is there a way to automatically tag the people in this video? I am uploading the the /videos endpoint using Curl in PHP, and getting the video id back as a response, and attempting to POST to /video_id/tags to tag users, but it isn't working. Is there a way to handle this?
Thanks,
Esa

Right, seems it is not possible to tag an uploaded video by POSTing to https://graph-video.facebook.com/me/videos (either when the video is uploaded with tags= or tags[]=, or after the video has been uploaded).
As a workaround, you could think about using an Open Graph action and tagging the action. For example, "Esa uploaded a video" and add tags for Esa's friends. This would also give you OG Aggregation stories in the user's timeline.
Info on tagging an OG action:
https://developers.facebook.com/docs/opengraph/actions/#taggingpeople

Related

Facebook like video uploader generate thumbnails before publish

Is there a jQuery plugin that could generate video preview thumbnails even before user uploads it? I notice that Facebook could do so but do not know any plugin that has the same functionality.
Try uploading a video on facebook, notice that even before you publish it or the progress bar is still in progress, preview images of the video are available already.
I tried searching the net and most answers pertain to installing ffmpeg having this as a reference.
I haven't tried it yet but looking into it, it seems that the video should be uploaded first before it could generate a thumbnail. But I what I want is a preview of the thumbnail to be generate BEFORE the video is uploaded (similar to facebook).
This is so that I have the transaction to select a video and generate a preview thumbnail at the same time even before the video is published on the server. Once I hit the "publish" button, it will upload the video to the server, upload/save generated preview thumbnail, save info to database at the same time.
I don't think you have to download a video and make its thumbnail. You can make a request via Facebook API to get it. You just have to precise that you want the attribute "picture" in the result; this attribute contains the path of the thumbnail of the video. You will find more explanation by following this link: https://developers.facebook.com/docs/graph-api/reference/v2.1/video/

Facebook: How to tag friend on video via taggable_id?

I want to upload video on fb timeline and tag user's friends on it. Uploading is pretty simple. I add binary data of video:
someUrlForm.AddBinaryData("file", binaryData, fileName, "multipart/form-data");
and call Graph API request that gives me uploaded video id:
https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}
Documentation suggests to use "mention" in video description like #[main_user_id] but so I can't tag people who doesn't have my app. Now /me/friends API is used for retrieving "main" (not taggable) id's of users who add the application.
The only way I guess is to use actions as described here. It has tags field for taggable_id. Problem is I want to tag not a self-hosted object form link but existing video on timeline.
Maybe I need to create custom action to upload video with tags?
The Graph API Video object doc specifies support only for page mentioning of the form #[page-id], and that is subject to review.

Facebook does not show thumbnail when a photo is shared

I am using the following code to share images on facebook but when the dialog box is shown it does not show the image and once it is uploaded facebook just shows a link to image.
<a name="share" type="button" href="https://www.facebook.com/sharer.php?u=www.example.com/myimage" target="_blank">share</a>
This should work like this
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=Our Site Title&p[url]=http://us.oursite.com/default.aspx&p[images][0]=http://www.history.malc.eu/globe.jpg&p[summary]=Our facebook description that is used on the FB share page." target="_blank">
Share this
</a>
EXAMPLE
Use the Facebook debug tool to see how Facebook processes the URL you're sharing.
The Facebook scraper will look for OpenGraph meta tags. You can reference the image you want as a thumbnail with the og:image and og:image:secure_url
Alternatively, if you wanted to upload the image to Facebook so that it goes into the user's album, you should check out How-To: Use the Graph API to Upload Photos to a User's Profile
To be more clear, you should not be sharing a link directly to the image, but rather to a page which has OpenGraph meta tags, one of which should link to the image.
Facebook doesn't support sharing of plain images, only hyperlinks can be shared. Try posting the same image's link on your profile as status. Facebook won't show you any thumbnail for it but just the link. To share a image on facebook, you have to somehow upload it -_-
From the social plugins docs the share initiates a callback from Facebook to the page you want to share. To affect what that shows you would have a page with meta tags (og:image, og:title and og:description) to affect what Facebook puts in the comment on the users timeline.
To show the image, you'd probably need a hosting 'page' that uses a thumbnail of your image in its meta data so that it appears in the users timeline correctly.
Facebook then polls this periodically. This is very similar to the like mechanism.
Make sure you use dont click on share more than once, after that you cant see additional changed you made for next 24 hours

Create the "Timeline Photos" album using Facebook Graph API

What I Want
I need to create the posts on a page wall with a big preview pictures - like the ones that are displayed when you upload a photo. It will make sense to add those photos to the "Timeline Photos" album of a user (or page) using the Facebook Graph API.
Sure I can poll the users albums list and search for a type:"wall" one (i.e. the Timeline Photos in the English translation), but what if the album does not exist? How do I create one or how do I make Facebook Graph create it?
What Have I Tried
Tried posting to /me/feed with a message and a picture URL (params picture or source), but all it does is just create a type:"link" post with a small picture, while what I need is a type:"photo" one.
Once again, I need that because of the big photo that gets displayed on a wall if post is a photo. For instance, that happens when I upload a picture to the album that gets automatically created for my application. But the issue is that when there are several photos posted one after another, Facebook automatically groups them in a set that belongs to an album.
P.S.
Basically, what I want to achieve is having an ability to send the posts to a page wall with big preview photos on the wall itself that are not grouped by an album name.
Please help. Thanks
Solved by posting a photo to /{page-id}/photos.
https://developers.facebook.com/docs/graph-api/reference/v2.0/page/photos

Using Flickr to Enable Images on a Site

Has anyone had success using Flickr to embed images that users can upload to my site, but that are hosted on Flickr?
Is something like this possible?
Thanks,
Alex
There is a flikr upload API:
http://www.flickr.com/services/api/upload.api.html
Have them upload their photos to your site, you can crop it or re-size it programatically with GD or imagemagick as needed, then use the flikr upload API to put it on your flickr account, then delete the original to save space, then embed it on the site.
This will save space for you. While also preventing your users from needing to get an account on another site, or having to leave your site to post photos, or figuring out how to link them back.

Categories