Facebook Graph API and videos - php

Is it possible to request all the videos associated with a face book account? So I can loop through and echo them to the page. Sort of like getting the json data of an album that has all the images within this album. I have been using [Facebook Graph API for Video][1]
[1]: http://developers.facebook.com/docs/reference/api/video/ as a reference.
I have it working for the albums and images so when a photo is added to face book it updates the website. Now I want to do the same thing for the videos.
Any ideas would be great.
Thanks!

It does not appear the Graph API offers access to a list of videos. You would need to use FQL
https://developers.facebook.com/docs/reference/fql/
And query the video table
https://developers.facebook.com/docs/reference/fql/video/
For videos owned by a user. Note you'd have to keep track of the last time you queried and limit your query only for videos with a created_time after the last time you checked.

Related

It is possible to crawl all images by a hashtag on Instagram?

Iam building a social network website.
I want to crawl information of ALL images by a hashtag on Instagram by using Instagram API. ( I only store url link to instagram image, without store image on my server )
Is is possible ? Or Instagram API only response a limit number of recent images ?
Thanks all!
When looking at the API docs, it seems that the total amount of media on a certain hashtag can be looked up, but the actual media can only be found for recent posts.
So if you actually want to save all media, you might want to scrape all data every now and then. You do have a limit on how many times you can scrape though.
Using API you can get all hashtag media, it will start with most recent posts, you have to paginate and can get call data.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
As of Oct 1, 2017, Instagram no longer gives permission for public_content scope that is required to access this data, if dont already have your app approved, you will not be able to use this API :(

How can I get related videos with php on youtube api?

I want to get related videos on Youtube when user enters the video id on my system. But system will work like this:
User will enter video id
System will find related videos of the video that user entered.
After that, system will choose one of the related videos and start to get that video's related vids list.
System will repeat this for 10 times.
And will show to user last video.
So, my problem is getting first video's related video and after last video's, after last video's etc... And my aim is try to find the journey from first video to last video.
How can I do this?
You can do this via search->list method specifying relatedToVideoId.
You can use PHP API client.
Here is a similar sample. https://github.com/youtube/api-samples/blob/master/php/search.php

Getting YouTube Channel Views

I'm trying to get the channel views of the logged in user, through googles' oauth2. I'm able to get name and email via this url: https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=[GENERATED TOKEN]
Now, I'm having a hard time finding any information about how I would go about getting the users channel views. I know you can get a list of videos and such, but how would I do this?
Is there an equivalent to the link I posted above? :)
You can do a channels->list
GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true&key={YOUR_API_KEY}
In response contentDetails.relatedPlaylists.watchHistory will have the playlist id of watched videos. You can iterate through that playlist with playlistItems->list.
GET https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2C+contentDetails&id={PLAYLIST_ID}&key={YOUR_API_KEY}

Get Facebook images based upon a description

I need to create a program which allows to store photos of which people has uploaded in Facebook based on the photo description. For example, I upload/post on Facebook a picture with the description "#awesomeevent" the program should be able to store this particular image into the database. Twitter has hashtags but Facebook do not any where which i can work around this ?
I was thinking of using a FQL query but unsure how to do it.
The best (and only?) way to do this imho is to include the hashtag in the message of the photos and read it from there. I would not use FQL for that, because there is no need to use it. The Graph API offers enough possibilities/connections to read photos:
https://developers.facebook.com/docs/reference/api/user/
(/me/photos, /me/photos/uploaded, /me/albums, ...)

facebook graph api getting only one picture in feeds

I am developing an app using the facebook graph api.
When I create an album with more than three pictures on facebook, on my wall post it displays three thumbnail images, but when I check in the feeds in the graph api, it only gives link to one image.
I checked out similar websites, and they also display three images like facebook not sure how to do this.
I think you are supposed to get the photos uploaded in a particular album,for that you can use
https://graph.facebook.com/facebook_d/albums
this will return all album details with album_id,using that album id you can fetch the photos in that album by
https://graph.facebook.com/album_id/photos.

Categories