MobiGM is a small utility that periodically checks your GMail inbox, and sends updates to a mobile phone via email. You just have to set up a some filters with Gmail's filtering sys to forward the messages directly to your phone and be happy with that, but MobiGM allows you to dynamically react to what appears in your mailbox (which we will exploit in future projects).
Technologies used/Requirements:
* GMail / atom feeds
* PERL
o XML::Parser
o Net::SMTP
* cron
* Linux
* BASH
* wget
How does it work?
GMail users can subscribe to an atom feed that contains unread emails in their inbox. We will write a simple script to download the atom feed, parse it, figure out if any emails are new, and forward the new emails to our cell phone address. Note that there are still some pay-as-you-go cellphone providers that do not charge for receiving text messages (even from email), so this can be a very inexpensive way to keep track of your inbox on the go.
There is a lot of potential to add power to this application. With a little knowledge of PERL, you could create custom filters (including things impossible with GMail filters such as "only forward during xx hours of the day") and reactions to receiving emails.
Let's begin.
Receiving the feed
Note: You could do this also in PERL. I'm doing it in wget.
The first thing the script needs to do, is receive the atom feed for your GMail inbox. We will use GNU wget to obtain the feed. In it's most basic form, wget's syntax is:
wget
However, we need to specify a few additional parameters, namely HTTP authentication username and password. As well, we want to force wget to always download to the same filename. It's normal action is to not overwrite files that already exist, so we have to override it. So, the syntax becomes:
wget -O
0 comments:
Post a Comment