how can i use php to get youtube user subscription channel videos and display all the channel feeds, i want create a class or function where if i pass a user name the php class would retrieve the latest uploads / activities in the user subscribed channels and display the url plus the title and the image, also i want to be able to pass the title and url to other functions so that i can save it to database. on a another page i found this Pulling in YouTube Videos from Specific Channel but its for only one specific channel.
The relevant requests are for the newsubscriptionvideos feed in the YouTube GData API v2 or activities.list() in the newer YouTube Data API v3.
newsubscriptionvideos might not be natively support in the Zend GData client library (I don't see it mentioned in the developer's guide), so if you go that route, you should probably use alt=jsonc to get back an easy-to-parse JSON feed of the data. E.g, https://gdata.youtube.com/feeds/api/users/jeffposnicktest/newsubscriptionvideos?v=2&alt=jsonc
The alternative is to use v3's PHP client library to call activities.list().
Related
Is there a possible way where I can retrieve a list (with thumbnails) of my latest videos from youtube, store the embed code in a database using a cron job so I can show the video on a separate page instead of leading the users to youtube to view the videos? (all in php)
you can try to have a look at this page: https://developers.google.com/youtube/v3/
Google writes that:
You can use the API to fetch search results and to retrieve, insert, update, and delete resources like videos or playlists.
I saw thath PHP API are still in beta version but you can try it out. You must register your application to obtain credential to use API. At developers.google there is a lot of documentation and some examples (https://developers.google.com/youtube/v3/code_samples/php#retrieve_my_uploads)
Using API you don't need to retrieve code and store it into database, you can just show videos directly in your web application. I hope this is what you was looking for let me know if it helps!
Luca
How can I fetch video using Vimeo API by their their or by their uploaded date?
Currently I am using vimeo.videos.getUploaded to fetch all the videos of a user but I am unable to pass parameters like title or date into that method call.
So please let me know how can I fetch videos of a user by video title or by uploaded date.
vimeo.video.getUploaded (and many other endpoints in the Vimeo API) allows you to provide a sort parameter of "oldest" or "newest".
You can experiment with this functionality via the playground :
https://developer.vimeo.com/apis/advanced/methods/vimeo.videos.getUploaded/playground
I need to access Youtube channel's demographics data with oauth.
One problem is that Youtube api called insight only provides zipped folders with csv files.
While I can probably download the zip, unzip, access the file, and delete the original once I get the data I need, I was wondering if there is any other way to get youtube channel's demographics data.
I believe that yes, using the new YouTube Analytics API:
https://developers.google.com/youtube/analytics/v1/available_reports
From the doc:
Channel reports
The table below lists the different types of channel reports accessible via the API. To retrieve a channel report, set the ids parameter value to channel==USER_ID, where USER_ID specifies the YouTube user ID of the currently authenticated user.
And I think that is the report you wants:
dimensions: country
metrics: views, comments, favoritesAdded, favoritesRemoved, likes, dislikes, shares, subscribersGained, subscribersLost
filters: video
or this one:
dimensions: ageGroup, gender
metrics: viewerPercentage
filters: country video(,country)
and this example shows how to call the API:
https://developers.google.com/youtube/analytics/v1/sample-application
In a PHP system, my client suggested to download videos AND MAINLY captions from YouTube using the following tools:
cclive
gcap
As I have never heard of these before, my question is does anyone have any experience with them? Both projects seem to be inactive for like one year or so... Do they still work?
Is it possible to download captions for any YT video with them? I have stumbled upon some YT API info that the captions are not available for unauthorized users (i.e. you can only get your own captions if you are authorized with the API)?
Caption tracks can only be accessed via the Data API by the authorized owner of a given video.
The official YouTube Players can access caption data, but they use a different mechanism for accessing that data which is not part of a public API.
What I want to do is, to show uploaded videos list of my youtube channel to website's visitors.
Something like that. (Image take from youtube channel, I want to show exactly this way)
Don't want to create iframe. Can I fetch data from channels exact page with PHP or something else? I have no idea if it's possible with youtube api. Any suggestions?
Yes you can. The videos on a channel are essentially a user's so using the YouTube GData API you can make a call to http://gdata.youtube.com/feeds/api/videos?author=ahmednuaman (my videos for example).