I'm making a script to monitor a 3D printer in the next room for a colleague. Using bash to take a picture, then upload to Dropbox.
He would like to be able to call a command ("/monitor or #monitor") to get the Dropbox link on slack but I cannot seem to find a relatively easy way to do this. Is there an app or not for those simple task?
The best way to do this is outgoing webhooks. Which is documented very well at https://api.slack.com/outgoing-webhooks.
Basically you get POST data on your web server, and you reply to it in JSON.
I use python flask and ngnix to accomplish very similar task.
You can easily implement a custom command on Slack using "slash commands". Every time you enter "\monitor" (or any other command you want to define) in Slack it will trigger a custom app that you then can connect to your bash scripts. You can also provide additional parameters in the command.
Check here for the documentation.
Related
I am developing a chatbot with Amazon Lex and I want to collect a description of a customers issue, save it to a variable, and send it through email. How can I implement this functionality?
I had a similar problem that I was able to solve by creating a Lambda function to access the user's inputTranscript.
You basically provide the Lex Bot with some sample utterances (which usually will capture part of what the user has said) and in your Lambda function, access the the event.inputTranscript. This is the last thing the user has typed exactly as they typed it.
My project was written in NodeJS so I used Nodemailer and the Gmail API to send the inputTranscript in an email. This is the video tutorial I followed at the time. It'll show you how to set everything up :)
If you are using Python, you can use the built-in library smtplib to send emails. Although I'm sure there are other options as well.
Hope this helps!
When I did research online, most of the solutions are about triggering Slack notification from TravisCI. Now I want to do the reverse direction - type some message in slack, and trigger a build task in TravisCI.
I'm looking at Slack's Outgoing WebHooks - under their "Custom Integrations" in Slack app directory. However, their webhook POST data spec is fixed, not seem to be programmable through just their webpage UI. They have a column in the UI that lets you fill in URL(s) to POST to. But I don't see any ways that I can customize the data field of the POST request.
Same as TravisCI's Triggering Builds API v3, the data fields they expect in the POST are fixed and unchangeable.
I know I can sign up a cloud service, write some code and spin up a server to re-package the parameters to do the work, like a middleware between these 2 APIs. But just want to see if anyone manages to achieve triggering TravisCI by Slack in such way that doesn't involve spinning up a server myself?
I ended up hosting a server and writing the porting logic myself. I guess there's no simple way to do this, after all they are different APIs. Here is the code where I request against travisCI API, and here is the code where I unpack the slack webhook POST request.
I am a beginner trying out api for fun.
The problem is, lets say, I want to write a simple windows program with golang to let my friends read and edit one of the sheets saved on my google drive. How can I do this without having them download a credential file?
What I want it to do is simply redirect them to the Oauth Page right away, and if their email address is one recognized by the app it will grant them access to that google sheet.
What i think you need is to integrate your go app with Oauth protocol.
More specifically, with the Google provider.
This is mainly 3 steps:
add the oauth client to your application
something like this: https://github.com/golang/oauth2
See their docs on how to do it.
go to google dev documentation and see how to integrate google auth flow into the client: https://developers.google.com/identity/protocols/OAuth2
I'm not sure if google has something more specific for google drive integration and/or go-lang client in particular. Please do some searching.
make the glue code on your go app so that the user can interact with this (the login button (or command, if it is terminal based), error messages, logout, etc)
More questions will appear when you start to do this, however it is a great example to learn Oauth as well.
General guidelines:
https all the queries or oauth is basically useless
oatuh has many auth-flows and you must choose which one(s) you support. use whatever google documentation recommends for m2m scenario (machine 2 machine)
log errors so that your friends can send you a log file for you to debug issues
maybe set some feature flag so that you can simply disable this feature to run/test localhost ? maybe useful? you decide.
Is there a way to way to get read receipt of sent mail?
Like which mail is read and which one is unread?
Using google apis Rest.
Read Receipt is no available in current version of google mail api.
provide third party solutions.
As of now Read reciept is not available.
but you can always write custom code to implement task.
Well, if you check the Gmail API documentation you cannot find any guides here that can achieve this. I found here a related SO question that try to use Apps Script in achieving this, but it seems that the Apps Script is also not applicable. I suggest you to file a feature request about this if you still want to do it with the Gmail api.
Are there any option through out the dropbox api namely the REST version, to programmatically exercise the sharing options or has anyone invented or discovered a unique approach to this using unix or nodejs command line tools? curl, etc, etc
I basically want to invite people to dropbox folders through scripts/command line and also accept invitations through scripts/command line.
Right now, to accept invitations you have to click 2 links, one in an email and then one within your dropbox web interface.
And in order to invite, one must login dropbox, click the folder you want to share and then enter an email and click a button.
I would like to do all this in simple 'ol terminal.
The Dropbox API currently does not offer any calls for managing shared folders (e.g., creating, accepting, etc.)
I've just released this little gem to do this using the web interface: https://github.com/Jesus/dropbox-invite
The proper way would be doing it through the API but since there's no official implementation I had to build a workaround.