I need to find an Api/webhook, source code for youtube. Specifically, that Api/webhook will send me a notification only when a specific youtuber makes a direct live streaming transmission.
Thanks for your help.
You may refer with this link: Is there a way to get notifications from YouTube API when broadcaster is live. It stated that it requires a websocket connection with your API endpoint by using ws:// protocole at some point. Websocket listen to a server, and enable your browser to handle it's changes like events. So it's exacly what u need for notifications.
Also, you may use the GET https://www.googleapis.com/youtube/v3/liveBroadcasts endpoint which returns a list of YouTube broadcasts that match the API request parameters.
However, getting a notification will require some work. It will probably require polling the endpoint for changes to determine if a new broadcast has been started. I'm not aware of a PUSH API from YouTube to send a request to an endpoint of your choice to create a notification.
More info in the YouTube docs.
Related
So i use studio flow for a whatsapp interaction. Sometimes our users lack internet, so we have an option to send locations in offline mode.
Once reconnected, we initiate a http_request in studio, that then uses the Twilio API to get all the inbound messages the user has been sending to whatsapp while offline. The http request only gets the last message send, so not the previous maybe 6 - 20 messages.
I can get the body text of all those, when i perform CLIENT.messages.stream. But not the geo information. As those are send in the Webhook POST request, that go to studio flow.
My question is thus how can i get the latitude/longitude? Is it possible at all?
Twilio does not store the geolocation data sent via WhatsApp. So you'll have to accept the geolocation data via the webhook HTTP request and store it somewhere else if you need to retrieve it later.
I am trying to use Twit to send and recieve Twitter DMs.
When I create a stream like this:
var stream = T.stream('user');
I get a 404 error. I believe this is because the user stream has been deprecated.
What stream can I use instead to send and receive DMs?
That's correct, you will need to use the Account Activity API to receive Direct Messages in realtime. This is a webhook-based API. Twitter has a migration guide.
In summary:
Create an app with a listening URL for Twitter to post events to.
Register the webhook
Listen for incoming Direct Messages
Use the REST Direct Message API to respond.
There's also a full tutorial on this using a JavaScript package called autohook.
I would like to access the messages in the Twitter via the API in real time. A cursory search showed that it is possible to periodically send API-request to Twitter. In general, this is possible. 15 requests in 15 minutes is enough.
But I'm wondering, are there other ways to get information faster?
For example, is it possible to subscribe to notifications and receive a request from Twitter at a certain address?
Are you asking if Twitter has webhooks? The answer is yes
Review Securing Webhooks documention taking special note of the
Challenge Response Check (CRC) requirements.
Create a web app with an endpoint to use as your webhook to receive
events (e.g. https://example.com/webhook/twitter).
Make sure your webhook supports POST requests for incoming events and
GET requests for the CRC.
Register your webhook URL with your app using POST
account_activity/webhooks.
Use the returned webhook_id to add user subscriptions with POST
account_activity/webhooks/:webhook_id/subscriptions.
An app that sends HTTP request to any URL and records the response in the database, if in case there is a response that website is dawn, it should automatical save the response and send a message into a slack channel. the first question is which library to use to integrate slack with laravel>
There numerous slack-api wrappers in PHP. But these two are some of the most expressive:
https://github.com/vluzrmos/laravel-slack-api
https://github.com/maknz/slack
Follow through the README and see which fits best your needs.
I have a video transcoding API and a CMS application which consumes it.
Workflow is as follows:
CMS sends a GET request to to the API to get a of list video files to transcode and it gets the answer in JSON format.
CMS user selects which file to be transcoded and clicks on the "Transcode" button.
As user click on the link, a POST request goes to API and API creates necessary Progresses internally and responds with initial status of the progresses in JSON format.
After creating Progresses at the API, I make GET ajax requests to API asking about the current process status periodically. Because it's a requirement for me to show user current status of the transcoding processes (like percentage..).
Additionally, I have some other resources that I should inform CMS about the current status.
At this time, I'm making an ajax call to API once in 5 seconds.
Here is the question:
Is this the best way to do it all?
Is there a way to create full-duplex communication between an API and a Rails app?
I tried pusher and push notifications but seems like they're only for front-end communication? Is this true?
I had heard about websocket but I couldn't find a good resource to fully understand it.
What is the approved way of Rails community to do what I ask for?
Thank you
To clarify: you need more than just server -> client communication because you need to inform the user/browser and also other components in the CMS about progress.
Note: not sure what technology the API is written in so I'll assume Ruby
Based on this Faye may be a very good solution. Both the web browser and the CMS server can be Faye clients and can subscribe to updates from the API. The API can publish updates to a channel appropriately named based on the video file that is being transcoded.
Browser <-> API Faye server communication will be over WebSocket or fallback transport.
CMS <-> API Faye server comms can be over the same transport types or they can use an Engine such as redis.
CMS sends a GET request to to the API to get a of list video files to transcode and it gets the answer in JSON format.
CMS user selects which file to be transcoded and clicks on the "Transcode" button.
As user click on the link, a POST request goes to API and API creates necessary Progresses internally and responds with initial status of the progresses in JSON format and the channel for progress updates.
After creating Progresses at the API, the client subscribes to the updates channel. As progress changes the API will publish the update progress to the channel and the client will receive the updates.
The CMS somehow needs to know the progress channel too. It could do this by having an channel that it always subscribes to. The API can then publish all transcoding information on that channel e.g. video-transcoding. When it sees a new transcoding has started it can subscribe to the channel for specific video transcoding updates.
It may be that bi-directional communication isn't 100% necessary. It seems like the API needs to push updates to the CMS and to the client. If that's the case EventSource/Server-Sent Events may be an option. And if you don't want the CMS to have a persistent connection to the API and would rather have updates pushed to it via HTTP you could add WebHook support to the API; on progression it makes an HTTP request to the CMS to inform it of progress.