Sending Contents of .txt File to Phone as Notification, Ideas?

Hello All,

It was kind of hard to summarize what I'm trying to do in the subject line but let me briefly explain...

I wrote a powershell script that scans a XML webpage for my region, and returns true if the current weather contains "rain". I then exported to a txt file and wrote a simple if statement to print a message like "It's Raining" if my match is equal to True. But all this is already done, and not really the basis of my question....

My question is: Can anyone think of a good way to take the contents of my txt file containing "It's Raining" and "It's Not Raining", and somehow have that appear as a notification on my phone?

The goal would be to have this run everyday at 5am on my server, and then through some automated process notify me. I though of email or text message, but I think the easiest solution would be to drop the txt file into a folder that's linked to Google Drive or something and have Google send me a notification. Hmmmm.

And P.S.- If anyone tells me to just check the weather in the morning; that's not the damn point! What I'm working on is way cooler and will help me to not be late to work!

I would have it sent as an email. If your server is running Linux it's really simple to send email from the command line, I'm sure there's some thing similar on Windows.

@Dexter_Kane I came up with a pretty elegant solution and others might find this interesting, I can post my code if anyone else wants to steal/expand on it. But anyway, using the IFTTT app for Android; I created a rule that said "IF I receive an email (gmail) with the subject line 'Rain!', then change phone background to [Image URL] (I used a rainy background image).

In Powershell it's pretty easy to send yourself an email using Gmail SMTP, and I've configured the If statements to only send emails if there is going to be bad weather for my region.

Nice, that sounds cool

For all the cool features IFTTT offers I really don"t trust them with my accounts. (I do not trust the services I have my accounts on with the accounts). But I've become somewhat of a Linux-tinfoil-hat guy lately.
You could do the same with a Raspberry Pi.

wget that XML
grep rain
check the output of that and then send mail via msmtp.

@Garfield I hear ya, I'm a tin foil hat guy too so it's all good. And thanks for the bash script, I plan to convert what I wrote in Powershell over to bash.

1 Like