Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to send notifications to your phone

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to use Python to send notifications to mobile phones, the article is very detailed, has a certain reference value, interested friends must read it!

1) register and download IFTTT on your mobile phone

2) Python3

Here are the specific steps:

1. Register configuration IFTTT

First sign up for an IFTTT account (https://ifttt.com).

After logging in to enter the page, click create in the upper right corner to prepare a new applet.

Click + this after entering, as shown in the figure.

Search for webhooks.

Go in and select Receive a web request, which trigger causes the webhooks to trigger an event after receiving a http request.

Write the name of the trigger

Then click that.

Search for notification.

Select send a notification from the ifttt app. This action enables ifttt to issue a notification.

You can format the message in it.

Where {{EventName}} is the event name we set earlier, and value1, value2 and value3 in Add ingredient are the parameters that the server uses when sending http requests.

Can be set to the following format:

Finish!

When we're ready, we can start writing Python scripts!

2.Python Notification scripting

Go to the https://ifttt.com/maker_webhooks page and you can see the webhooks you just created.

Click Documentation in the upper right corner.

You can see the Key of your application. This Key is important and will be used to send requests.

Webhooks is called by sending a POST or GET request to the following URL:

Https://maker.ifttt.com/trigger/, your event_name/with/key/, your Key.

You can also put three parameters in body in json format, such as {"value1": "this is a test"}, and the Value1 in the final notification will be replaced by this value1.

Make a notification script, for example, create a new file called notice.py as follows, text can put the text you want to send.

You can put this file on your local machine, or you can put it on the server with some function.

Remember to download IFTTT on your phone and log in first.

The effect is as shown in the figure:

The above is all the contents of the article "how to use Python to send notifications to your Mobile phone". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report