E
E
elliadan2010-11-12 21:28:09
Google
elliadan, 2010-11-12 21:28:09

New mail notification via Google Calendar?

Is it possible to somehow implement a new mail notification on Gmail through Google Calendar sms notifications?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
diarworld, 2010-11-13
@diarworld

I will write my solution (for linux systems). Create a file /bin/GMAIL with the following text:



#!/bin/bash
read var2 </root/flag
var1=$(curl -u LOGIN:PASS --silent "https://mail.google.com/mail/feed/atom" | grep -c "")
if [ "$var1" -le "$var2" ]
then
echo "No new emails"
read var3 </root/theme
echo "Last email: $var3"
else
curl -u LOGIN:PASS --silent "https:// mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '' '{for (i=2; i<=NF; i++) {print $i}}' | perl -pe 's/^(.*)<\/title>.*(.*)<\/name>.*$/$2 - $1/'>/root/theme
var3=$(iconv -t UTF- 8 /root/theme)
google calendar add "$var3"
fi
echo "$var1">/root/flag


The login and password in the text are indicated from the mailbox. In the terminal we write:
chmod +x /bin/GMAIL
Next, download, install and configure the package from Google to work with the calendar from the command line: code.google.com/p/googlecl/ The project page has complete installation and configuration instructions. You need to configure for the calendar to which you are subscribed to receive SMS.
If everything is done correctly, it remains only to configure the /bin/GMAIL script to run by cron once a minute. Create a file /home/user/tst with the text:
SHELL=/bin/bash
MAILTO=user
0-59 * * * * /bin/GMAIL
Write in the terminal:
crontab /home/user/tst
touch /home/user/theme / home/user/flag
Everything is ready! Now, once a minute, your computer checks your mail and if there is a new letter, it creates an event in the Google calendar with the author and title of the letter, which will come via SMS :). Also, now you can check the mail "in haste" by simply writing GMAIL in the console - you will find out if there are unread letters and the author with the title of the last letter :)

K
Kir Shatrov, 2010-11-12
@RazoR_Empire

habrahabr.ru/blogs/sysadm/96099/

3
3ds, 2010-11-13
@3ds

Does it have to be through the calendar? If it's about SMS notifications, then everything is simpler:
1. Connect the free sms2email service on your phone.
2. In the gmail box, set up redirection of all incoming (or necessary) using filters to this email.
3. Enjoy notifications.
PS works for me :)

E
elliadan, 2013-04-15
@elliadan

I will answer myself, if suddenly someone, like me, is looking for an implementation:
habrahabr.ru/post/145447/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question