Is there an API which allows me to send a notification to Google Hangout? Or is there even a python module which encapsulates the Hangout API?
I would like to send system notification (e.g. hard disk failure reports) to a certain hangout account. Any ideas, suggestions?
Hangouts does not currently have a public API.
That said, messages delivered to the Google Talk XMPP server (talk.google.com:5222) are still being delivered to users via Hangouts. This support is only extended to one-on-one conversations, so the notification can't be delivered to a group of users. The messages will need to be supplied through an authenticated Google account in order to be delivered.
There is pre-alpha library for sending hangouts messages on python:
https://pypi.python.org/pypi/hangups/0.1
The API have been reverse engineered and is not published (as someone posted in comments). Thus it might change a Google's will.
Also, messages sent using XMPP ceased to be delivered to Hangouts users. I guess this is another cut (of the thousand scheduled).
I send alarms and other notifications with a python script (failures on database server, partitions without free space, etc), using hangouts. It's easy. Look at http://www.administracion-linux.com/2014/07/enviar-mensajes-por-hangout-desde.html to send hangouts.
Related
Does anyone know what would go into sending text messages with Python WITHOUT the need for a 3rd party API? What knowledge do I need to have to achieve such a thing? I've only been coding for a few months, so I still consider myself fairly new and there's a lot I don't know about networking. I know there are services like Twilio that offer a python library for sending text messages, but if I wanted to type out my own script, from scratch, what would need to go into it. I'm willing to read some documentation if that's necessary as long as it's not hundreds of pages long. Being as detailed as possible in your response is greatly appreciated. Thanks!
This can be done by sending an email via SMTP to the SMS gateway of the carrier of the recipient phone number. Each carrier has a unique email address usually in the form of {number}#{host}. Within Python, you can use the builtin smptlib (or aiosmtplib) library to send the email. I wrote an example script here to send using GMail.
Please tell me if I did not understand your question correctly, then I will try to improve it or I'll delete it.
Sending an SMS requires something, that can send an SMS. Which is normally not your laptop / PC, except it has a SIM card and a mobile phone modem. So you need a mobile phone or a service, that offers sending SMS if you subscribe / pay.
Most professional available services allow to send an SMS with simple HTTP GET or POST requests, so you don't need a third party python module, but you must connect to a third party web API in most cases the python code is really simple, but first you need an SMS service provider
Some services also allow sending SMS via SMTP (sending emails) which
#acamso adresses in his response
If you have an Android device you could install shellms on it ( https://f-droid.org/en/packages/com.android.shellms/ ) connect it via USB to your PC and use adb to send SMS, which will be billed on your phone's bill / contract.
I am not aware of any SMS service, that is for free, so if you subscribe to an SMS provider it will provide you with an API, that can normally very easily be handled from python.
I want to develop an app that sends me an email when pricing offers for specific listings change using the AnyOfferChanged MWS notifications. However, I can't find any good documentation on how to go about receiving the notifications. Is it a must to have AWS SQS, or can I use Django? how do I go about subscribing to a notification?
I already have a developers account and I'm using the python mws library
You need to subscribe to the AnyOfferChangedNotification through the Subscriptions API and yes, it must use SQS. I found it easiest to use the scratchpad to create the subscription, since it's usually a one-time event.
Once your price change notifications start flowing into your queue, write an app that reads the queue and you can respond to your messages, including sending an email if that's what you want to do.
See if these code samples for SQS help you: https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-python-example_code-sqs.html
Google Cloud Functions allows you to easily activate a function upon a trigger (eg Firebase data change, HTTP request...).
I am looking for a way to execute a function when a user sends (or typically replies) to a email address. For instance, my dashboard sends an email, I would like to catch the reply, parse the content and upload it to Firebase as a comment in my Dashboard.
I understand that Google recommends to use Sendgrid. I however don't understand:
- How to setup the trigger upon a reply
- How to read the content and set the reading
I only found how to send emails here
One option if you use GSuite is to use the Gmail watch mechanism to listen to new emails in your inbox. The message can then be posted to a PubSub topic which can trigger a Cloud Function to parse the email and perform your necessary next steps.
Here is a good use case that explains this mechanism
https://cloud.google.com/blog/products/application-development/adding-custom-intelligence-to-gmail-with-serverless-on-gcp
Google Cloud Functions does not provide a permanent listener on an endpoint. There is also no event source for SMTP, which is the protocols involved with email delivery. So you can't simple respond to emails as they come in with Cloud Functions at the moment.
What you can do is direct the traffic to an existing SMTP server, and then use Cloud Functions to read from there at an interval.
An alternative is to use the Sendgrid Inbound Email API, which can call a webhook for every message it receives. And your webhook would then be a HTTP triggered Cloud Function.
This might seem a lame question, but would be great if someone can help. I wrote a small python script which returns some output based on a command sent to it via slack's custom bot. Python script uses RTM API. Whenever someone in slack mentions the bot and passes a command (ex: #slackcustombot foobar), it returns a custom message(ex: Hi foobar) from the script. Now the issue is at the security side. My script resides at a server which is not open to internet. And as Slack uses dynamic IP, there's no possibility of white-listing the slack ip's.
So basically, all I wanted to know is, when someone in slack channel mentions the bots, and when the bot at slack server sends the command to my python script residing at my server, does it send as GET method or as POST method? cuz if it's a GET method, I might not have to worry about the security issue. but if it sends as POST method, what alternative I could use in this scenario? Any help is appreciated. Please correct me if I am wrong somewhere, still learning. :)
Regards,
Junaid.
Neither. It uses the WebSocket protocoll. If you rather want to use a HTTP-based protocol I would recommend looking into the Slack's Event API. It uses HTTPS POST to transfer messages to your bot.
The Events API is not providing all event types that are available with the RTM API, but its much easier to handle and should be sufficient for a chat bot. Check here for a documentation of which event types are available to the both RTM API and Events API.
You will however need to find a way to expose the url of your bot to the Internet, so that Slack can use it. If you need to access internal company applications through your Slack bot, the best approach in my opinion is to have the Slack bot on a webserver in the DMZ of your company.
A more small scale approach is to use a forwarding provider that is connecting to your local webserver through a VPN tunnel and exposing your internal webserver through a special public URL. That would work if you want Slack to talk to your webserver on a local network behind a router / firewall. One example is ngrok, but they are other providers too.
So I'm kind of stuck. I'm trying to implement Twilio ip messaging for our app and I'm not sure I'm finding what I need in the docs.
From what I see as examples - the only things that the backend is responsible for is the credential generation - something I have done.
Should the backend also not somehow facilitate the message sending and conversation generation?
Any useful information/documentation links/tutorial links would be much appreciated.
Twilio developer evangelist here.
The message sending and conversation generation can all be done through the client libraries, either the JavaScript or iOS (or, coming soon, Android) SDKs. That way, other than the credential generation as you pointed out, your servers don't need to be responsible for the rest of the chat application.
You can, if you choose, send messages from your own server too. Check out the documentation on the IP Messaging REST API.
If you want your server to interact with messages sent by the client libraries you can also subscribe to webhooks for IP Messaging too.
Let me know if this helps at all.