I am currently using IFTTT to create some automated software with Amazon Echo (Alexa). I want to use the IFTTT's Maker channel to do so.
Here's what I want the end result to be:
Command Amazon Echo (Alexa) to run a program.
Run a Python program on my computer.
I have had success in using the Trigger function of the Maker channel using a JSON request. However, there seems to be little documentation on the Action function, where IFTTT can make a web request to a URL. I have heard that webhooks may be needed to use this, again I am not sure where to get started with this.
The image below is what the Action function asks for. I know I'll need a server on my local machine or a program reading any requests sent to a public website.
If there are any libraries that would make this much easier, I would happily take recommendations, as this has been on my mind for a while..
Thank you!
Related
Hi everyone so I’m new to developing bots for Telegram with Python and I need help being able to generate the basic get updates information. I usually can when I use the web browser, you know when you drop the telegram link with the bot token key and finish it up with the GetUpdate function in the address bar then the browser just generates a page with all the info such as chat_id, user_id, firstname,last name, etc. Yeah I want to know how to do that with Python so I can achieve the same results in the python terminal. I’m working with the telegram bot for python package so I think it’s called telegram.ext. I’m using the basic guide which involves me using the Dispatcher and Updater, I’m still learning from the guide but for now I need to know how to get that system/session info using my bot in the python terminal. Feel free to ask any questions to clarify this question, thanks.
So far I the most I can do is print out messages I’ve sent to the bot but that’s about it, it’s pretty much filtered and I don’t want that I want the raw and unorganized information like browser usually provides.
The easiest way is to use requests library:
import requests
r = requests.get('https://api.telegram.org/bot<BOT_TOKEN>/getupdates')
print(r.json())
This is what I want to do as soon as I get Sms:
Message received
Read contents
if contents=='abc' do process 1
I know how to do it using Ngrok but I do not want to update localhost address in Twilio for every new session.
Twilio developer evangelist here.
If you know how to do this using ngrok, then you're halfway there as you have presumably built the application that performs this task and run it locally.
If you want this to run permanently with a URL that doesn't change, then you will need to deploy your application to a server somewhere, and point a domain at it. Since you're using Python you might try something like Heroku to host the application. Alternatively, if you rewrite your application in Node.js you could take advantage of Twilio Functions to host your code.
Let me know if this helps at all.
Actual situation:
The client downloads a small pythonscript that is executable.
The client executes it. The script gathers information from the computer and sends the data to the webserver vià POST-Method.
Wanted Situation:
After the webserver recived the data, it should forward the information to the website-session of the client. And the website should display the information.
This is a visual example of the principle:
There is also a example of this principle on Can You Run It.
How can I realize this?
A common way of implementing this is using a RESTful API. Basically the API does not care if the request is from a script or web browser, it just passes data structures to and from clients. The only tricky part to your example is when there are multiple users involved because a secret must be shared between the browser and script. I believe Can You Run It puts this unique secret into the program they ask you to download.
Look into Django Rest Framework for examples of how to implement this.
I am developing a python program which uses the gmail api to access the email data.
I have successfully developed the tutorial program and I am able to access the gmail data and do a lot of interesting things.
At the moment, I have to get the .json file from the gmail account, modify the code, run it, and then ask the user to get a verification code from the web browser, to finally authenticate the app so it can start running.
Now, my question is: how can I make the authentication process easier for the end-user?
It seems to me like this process is during the development of the software, but what if I have finished my development process and I want to make the app commercially/freely available to other users so they can start poking around with it?
Isn't there a way to quickly modify my software to make that process easier for the end user?
Any kind of help is well received, sorry if this had been asked before.
I'm new to OAuth and API's but have been trying to figure out the upload_video.py script that is provided by Google (https://developers.google.com/youtube/v3/guides/uploading_a_video) to upload videos to my channel via Python.
My problem is I can't figure the OAuth, so I'm calling the script with the necessary arguments, but then getting re-directed to an authentication page in my browser.
This script needs to be run completely invisibly from command line and so, that doesn't work for me.
Can anybody point me in the right direction for not having to authenticate the script manually each time it's running?
I was hoping there would be an option for this in the Google dev console, to allow this kind of thing, but it doesn't appear so.
Your program will have to at some point use a browser to complete the OAuth2 flow - it's unavoidable. The script google provides on that page does store the token in a local file, so that your program won't need to go through the process again every time it runs, as long as the token is still valid. You can also get your program to ask for a new token when the one it has expires, though I'm not sure if that script actually does that or not.
See: https://developers.google.com/accounts/docs/OAuth2ForDevices for information about the OAuth2 flow on devices that aren't capable of launching a browser themselves.