Is there a way to get a callback if a user subscribes to a youtube channel via a subscription_center ( http://www.youtube.com/t/creators_downloads ) button? Doing an onclick on the link does not guarantee a user subscribed. Thanks
I'm sorry, but there's no API around that button at this time.
turns out they have added a callback now.
https://developers.google.com/youtube/youtube_subscribe_button#Handling_Events
Related
I have Slack message posted using postMessage & Attachment. It has Title and Title Link which opens the External URL. I wanted to capture the link click event when User click on it. Is it possible to wire click event and handle it?
No. The Slack API does not provide any means to "capture" the click event and do anything else then open an external link in the browser.
The requirement is to get events (subscribe button click ,like button click , comments , etc ) from youtube to my Nodejs or php application.
I found some websites like livestreamalerts.com, they are providing feature like this
Thanks in advance. :)
Context:
I am developing a Ruby On Rails application and I started using React.js to manage my javascript components.
My application provides a facebook-like chat: several chats are displayed at the bottom of the page.
Problem
I have a ChatList component that renders the chats. A chat is made of its messages and its form. When this form is submitted, an AJAX call is made to the server to POST the message and the message is added to the current chat.
this.setState({messages: this.state.messages.concat([newMessage])});
The server then broadcast Javascript code to the receiver.
This is where I'm stuck. How can I add the message to the correct chat? How can I select my React.js component and change its 'props'?
When I was not using react, I used to broadcast this code to the other user:
$("#chat-<%= chat.id %>").append("<%= message.content" %>);
I guess I have to find a way to select the React component (the chat instance) and change its property "messages". How?
Thank you for your help! :)
EDIT: I'm going to add more information, just in case:
My ChatList is a global variable that takes an array of Chats.
Each Chat takes an array of Message and a form.
When I submit the form of a chat, it adds the message to the Chat (locally and it also posts the new message to the server). When the server receives the POST event, it can render javascript code to the other user.
This code should add the message to the correct Chat for the correct user. There are two pieces missing:
I don't know how I can "select" the Chat.
I don't know how I can add a message to the "messages" array of this Chat.
You'll want to have your chat component listen to a WebSocket event for a new message and then call setState when a message is received.
The standard approach with Chatrooms is to use "channels" that each chat room subscribes to. That way it only hears about incoming messages from the conversation it cares about.
Check out Socket.io and its example on making a chat application. Even if you don't use Socket.io the example will be illustrative.
The solution, in my Chat class:
componentDidMount: function(){
this.props.privateChannel.bind('message.new', this.receiveMessage);
},
receiveMessage: function(message) {
if(message.user.id == this.props.recipient.id){
this.setState({messages: this.state.messages.concat([message])});
this.startBlink();
}
},
Does anyone know if the YouTube scubscribe button (the one that appears in widgets on various websites) has a callback function once the user has clicked subscribe? I have looked into making my own but due to the fact they load in iframes I dont think its possibe.
It currently (2013-01-08) does not: https://developers.google.com/youtube/iframe_api_reference
Yes they recently added a callback function. In their GUI for creating a subscribe button, you can check "My application listens for button events." and it'll include the callback in the widget code: https://developers.google.com/youtube/youtube_subscribe_button
Is it possible to answer to an event using facebook connect, by calling the method requestwithgraphpath like this:
[[Facebook shared] requestWithGraphPath:link/attending andParams:params2 andHttpMethod:#"POST" andDelegate:self];
What about changing the answer? (Do I have to call "DELETE" to attending and then call "POST" to maybe or declined ?)
I am using the permissions rsvp_event and user_events
There's a blog post here from when the API was last updated with an example of some of the API calls, the main docs are at https://developers.facebook.com/docs/reference/api/event/
Basically, to remove a user from the event it's a DELETE to /{event id}/invited - this one may require the 'create_event' permission as it's a modification to the event, i'm not 100% sure.
To change RSVP status it's a POST to /{event id}/{status} where {status} is one of attending, maybe, declined