Dynamic email signature for your mail clients

Actually it is not that dynamic. Basically I just want to embed the list of my 3 latest blog postings in all my outgoing mails, just below my signature. So what I meant by dynamic is that the text file which is holding the signature will get updated from time to time via a cron-job and a simple script.

The script will read the RSS/Atom feed from my blog and capture the title & url of three latest postings and pump them into my signature file. I use Python script and the marvelous Universal Feed Parser.

For most of linux system python would already been installed by default. However you might need to install Universal Feed Parser (python-feedparser) in order for the script to work.

In my Gentoo machine
emerge -av dev-python/feedparser

For Fedora Users
yum install python-feedparser

For Ubuntu users
apt-get install python-feedparser

The phyton code (take note that I’m new to python. If you find that the script is not appropriate please do advise me)


#!/usr/bin/python

import feedparser

#the signature file (output)
filename = '/path/to/your/home/folder/.signature1'

#numbers of items to be displayed
num = 3

#feed address
feedurl = "http://feeds.feedburner.com/RidingLinux"

#your signature. Change accordingly
text = """Regards
Your Name
Your Company
Address
Telephone

My latest BLOG posts:

"""

d = feedparser.parse(feedurl)
if d.feed.has_key('title') :
	file = open(filename, 'w')
	for i in range (num) :
		text = text + d['entries'][i]['title']+"\n"+d['entries'][i]['link']+"\n\n"
	file.write(text)
	file.close()

Save the above script in your home folder (eg: /home/yourname/signature-update.py) and test it out.
Once everything is ok, add a cron-job for it to be executed in schedule.

Example (if you are using ‘crontab -e’) command

0,30 * * * * python /home/yourname/signature-update.py >/dev/null 2>&1

This will execute the script every half and hour.

Sample generated file

Regards
My Name
My Company
My Address
My Telephone Number

My latest BLOG posts:

Vuurmuur firewall management interface for Linux Iptables
http://www.ridinglinux.org/2008/06/23/vuurmuur-firewall-management-interface-for-linux-iptables/

Food Strainer - Your Wifi reception booster!
http://www.ridinglinux.org/2008/06/15/food-strainer-your-wifi-reception-booster/

Simple port forwarding with Iptables in linux
http://www.ridinglinux.org/2008/05/21/simple-port-forwarding-with-iptables-in-linux/

Now I can simply point my mail client (Evolution, KMail, Claws-Mail or Thunderbird) to use the above file as my signature.

Popularity: 8% [?]



Stumble it!

RSS feed | Trackback URI

1 Comment »

Comment by cooles
2008-06-30 20:34:03

Nice tips. Thanx

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> in your comment.
Sexy lesbian BDSM squirting pussy pregnant teen asian shemale fuck bisexual teen sex girl foot fetish Adult dating tutorial Housewares Shop PORN FREE VIDEOS levitra purchase uk online viagra buy generic viagra online on line cialis soft tabs buy viagra soft tabs nichole double cum fat booty Blowjob Ninjas Lindsay Enjoys A Fat Cock porn videos free sex cam drunk madyson captain stabbin Evie Delatosso beach trannies boob tits stockings on pornstars klipal cream for women natural tramadol where to buy where to buy valium on line xanax on line uk rx pills Trazodon diazepam called in to local pharmacy viagra order levitra for woman oxazepam 0.5mg 100 tabs free zyban order online buy cialis buy lorazepam uk ed pharmacy women use tenuate free cialis soft tabs without prescription uk viagra soft tabs body building from sports supplement buy levitra in the uk canada online pharmacy cialis natural substitutes for viagra viagra prescription purchase cialis porn sex cialis soft tabs uk viagra soft tabs pharmacy cialis online discount whats a female viagra no prescription levitra natures alternative to cialis soft tabs generic viagra soft tabs cialis cheap levitra cheap viagra and pharmacy humor levitra in woman generic viagra india cialis female opinion