Glympse API event handling - glympse

I am trying to launch glympse app by using an intent and receiving the information through broadcast. Is there any way that I will be notified about the events occurring like ticket removed, expired, updated etc?

There sure is.
We created a library project to make this easier for you. It can be found here: https://github.com/Glympse/glympse-app-sdk/tree/master/Android/GlympseIntentsLib
A sign-in is required to view these documents that might be helpful.
Tutorial: https://developer.glympse.com/Content/client/app/guides/Glympse_Intents_Tutorial.html
Reference Docs: https://developer.glympse.com/Content/client/app/guides/Glympse_Intents_Reference.html
Specifically, check out the method CreateGlympseParams.setCallbackAction(String). This will allow you to set an action which will be used to broadcast a message back to your app.
Another option is to use CreateGlympseParams.setEventsListener(EventsListener). With this method, you can supply an object that implements GlympseApp.EventsListener. Using this method, our library handles the broadcast under the covers and your object's methods will be invoked as the event occur.

Related

How to make Slack app send a private message via an incoming webhook to someone specific?

I created a Slack app that sends a series of interactive messages to a channel. In my Slack API dashboard, I see that I can create and remove hooks. Right now the hook url that I have set up in my code is the one for the Slackbot channel.
But the problem is that such a message only gets sent to me.
I want to send the Slackbot messages to Alice in situation A, and to Bob in situation B. Not just to myself, the guy who configured the app.
What's the best way to do this?
I would suggest that you should not use hooks for this. A more sane way to do this right would be via chat.postMessage Web API method which is documented here!
This is because hooks are tied to specific conversations and that approach quickly hits a wall on what it can really achieve, especially messaging different people. Once you start using the web API it's pretty simple. Just ask for the scope during app installation (remember to add that scope in your dashboard), subscribe to the event in your API dashboard and then you are good to go.
Everytime you send a message via that method, Slack will send you a payload which you can use for testing and logging etc.
You can see all the different ways to message programmatically inside Slack here.

How to add a dynamic results section to Laravel

I made a laravel app which uses an index method that delivers a collection of the client's available appointments (think hairdresser) to the page (as an api), which I then display using vue/vuetify.
The client is saying they would like the appointments on the page to be dynamic/live eg if someone books an appointment, then all other logged in users will see that appointment disappear from the list on their screen.
I have no idea how I would do this, although I have had one idea - I somehow incorporate node/non-blocking on the server, like a chat room, but only for this part of the app.
Or is there a way to do this with laravel/nginx?
Thanks in advance - I don't know what to search for!
I believe you are looking for Broadcasting (Documentation Link). You would need to:
Configure your broadcasting driver (you could give pusher a try for quick setup and tinkering)
Configure your Laravel backend to dispatch a new event whenever a new appointment is made, (e.g. event(new AppointmentCreated($appointment)) where AppointmentCreated implements the ShouldBroadcast interface. You can combine this with Model Events
Update your frontend to receive your broadcast (Check Laravel Echo). Once you receive a broadcast, update the UI to mark this appointment as unavailable i.e, make it disappear

Disallow user to make a call when there are no more credits: Sinch Javascript SDK

My application allows unlimited instant messages for free, but takes credits for calls. I want to be able to disallow user to make a call when he does not have any more credits. How in a ideal scenario is this managed using javascript SDK?
I am coming from a standpoint, that although I am able to control this behavior through some validations in code itself, but what happens when the user is a hacker? He can go to console and call javascript methods of its own such as removeListeners and then callClient.callUser(userId). How do you protect sinchClient in such case? Thanks.
Note: I am open to provide more information if the question is not clear.
Sinch exposes a REST based callback mechanism to control your call flow. You can set a callback URL in the Sinch Portal under Applications >> Voice and Video settings. Each call will then trigger a Incoming Call Event (documented here: https://www.sinch.com/docs/voice/rest/#callbackapi) and you can control whether or not to connect this call via the callback response.

How to subscribe to a notification stream for packet_In processing?

I am writing an external application that uses REST to communicate with open-daylight. I need to get a notification whenever a new communication between two nodes is needed.
I've checked how to subscribe for event notification in the following link. But I am not sure if this is possible for a packet_in event.
Is it possible to get a notification of the new connection packet_in, with/without some information about the packet?
What would be the path used to create-data-change-event-subscription? also, how can I check all available events and paths that I can make use of?
I believe the "packet_in" event is a yang notification however the REST notification subscription mechanism is for data change notifications. Unfortunately there is no mechanism currently (that I know of) to subscribe to yang notifications over rest.

Creating a Slackbot that adds

Hey in my team's slack (messaging system for those who don't know) we have an automatic response, so that when anyone says "trump", slackbot automatically responds with "the wall just got ten feet higher". Now I want to make a counter that essentially allows slackbot to state "the wall just got ten feet higher, wall height:(have a updated value according to number of times "trump" has been stated)" So basically I want a way to have a value that updates the wall height but I am lost on how to do that within slackbot. Any help is much appreciated, thanks to all!
The default features provided by Slackbot only allows it to respond to keywords, but not much more. So to provide that additional feature you would need to develop a custom bot.
For your use case I would recommend building a so called internal integration for Slack using the Events API.
Internal integration allows you to add custom functions for your Slack team only (as opposed to a full fledged Slack app, that could also be installed and used for other Slack teams).
The Events API allows you to set up a bot that listens to messages and can react to keywords like "trump".
An alternative approach to the events API would be the outgoing webhook. However this function is now deprecated and should no longer be used. Also it only works with public channels.
To set this up you will need to develop a small webservice (e.g. in PHP) that listens on a webserver for requests from the events API, keeps count of how many times the keyword has been invoked in the past and sends an appropriate message back to your Slack team every time the keyword is used.
I can recommend reading the excellent official Slack API documentation if you want to learn more.
If you are familiar with PHP this can be done easily using the Slackbot Framework. It supports Events API allowing you to listen to messages in channels or direct messages (depending on the permission scopes of your APP). So all the conversations on Slack can be sent to your server and you can search for the specific keyword in every message. Then send back an appropriate message to Slack. In summary, the first step is to create an APP for your slack team at https://api.slack.com/apps?new_app=1. Next step is to install the Slackbot Framework which is explained here. Hope this is helpful.
That can also be done by integrating custom slack bot using Django. You'll have to subscribe events and based on events, Slack will send conversation message to the given url, and based on the event, you can write your logic to increase count and post message back to slack work space.

Resources