With YouTube Data API we can parse comments from a certain video, reply to these comments, modify and delete our comments etc. But in this aforementioned documentation I didn't find the way to fetch the user comments in real-time. So the situation is like - apart from fetching comments when the API is called, I want the API to proactively update me with most recent changes if any new comment arrives or any modification or deletion happens. Any way to achieve this?
The only way to find out of there have been comments its to poll the API and check every now and then. There are no push notifications for comments if that's what you are looking for.
Push notifications only work for.
push notifications
uploads a video
updates a video's title
updates a video's description
Related
I can't find any documentation with yt api to fire an event whenever a new user subscribes, but I wonder how people on live streams add new subscriber info on their videos whenever someone subscribes.
I'm trying to get the same youtube subscriber notification like people do when they are in livestreams.
But I can't find any way to do it.
I thought of setting interval of checking channel, like if the sub count increases, check the latest subscriber from subscription list.
But this is kinda complicated and can't handle multiple users when they subscribe.
So my question is how does the youtuber's subscriber notification works and how can I replicate it in a nodejs project for example:
async function newSub(sub){ myWeb.send(user.name+ " Thank you for subscribing"); }
I'm sending a get request to a link like this:
https://www.googleapis.com/youtube/v3/search?part=snippet&channel_id=[MyChannelId]&type=video&eventType=live&key=[MyKey].
The purpose of it is to get the live events of a specific channel for which I provided its ID.
The problem is this does not work all the time.
When I go checking in YouTube, the channel is streaming, but I don't get any data through this link.
What are the possible mistakes that may cause this?
Or is it just a problem from their servers?
Is there an alternative reliable way?
I currently working on a project where I send a youtube video id and show it to the user. And I want to know if there are a method to know when the video is completely viewed by the user. In my application's client, I send a response to the server when the view is completed, and I want to prevent receiving falsed data from untrusted user. And that's why I want to know if youtube api make a things like that. I have seen other similar topics, but I haven't found a safe way to secure communication between client and server for this problem.
Thank you.
From this SO post, it was mentioned that you can use onStateChange event to log that a user viewed a video. But the general idea here is about safety which I think is more important, from there I don't think you can do this as per the privacy of a user. You can understand more about YouTube Reporting and Analytics here.
I'm trying to use the YouTube API to get my discord bot to send me a message when I post a new video, but since I'm a beginner I do not know how to do this. The idea is that it looks like this: http://prntscr.com/j8je80 , the embed is ready but the api part of youtube is still missing.
You needed to subscribe to push notification.
The YouTube Data API (v3) supports push notifications via
PubSubHubbub, a server-to-server publish/subscribe protocol for
Web-accessible resources. Notifications are pushed out to subscribers
via HTTP webhooks, which is much more efficient than polling-based
solutions. With PubSubHubbub, your server finds out about events in
near real-time, without having to determine the optimal polling
interval or repeatedly fetching data that hasn’t changed.
So these are the following activities that will trigger the push notification:
uploads a video
updates a video's title
updates a video's description
To be able to implement these, there is a step by step explanation on how to subscribe.
I am looking for some sort of webhook that notifies my app when a new video is uploaded by a channel, so that I can create a new Video object in my app.
The only resource I could find was youtube push notifications, but not sure if this is what I'm looking for or how to implement it in a rails app.
Could I get a brief overview on how to accomplish this?
It looks like you have found your answer. I'd recommend working through the Youtube Api and push notifications docs starting with the page you found, then looking at the PubSubHubbub github docs since that is the solution google has implemented for you. In the process you will probably become much more adept at working with the youtube data API.
Alternately you could use a scheduling gem to periodically check the list(s) yourself but I believe this might end up being more work for a worse solution.