import httplib, urllib, re, sys, os, string, time, smtplib from ConfigParser import * true = 1 false = 0 print '\n' print time.strftime( '%H:%M:%S' ) def has_entry_changed( entry, file ): if not os.path.exists( file ): print 'First run, current entry is: ' + entry log_entry( entry, file ) return in_file = open( file ) contents = in_file.read() in_file.close() if contents == entry: print 'No new version is available' return false else: print 'A new version is available' log_entry( entry, file ) return true def log_entry( entry, file ): out_file = open( file,'w' ) out_file.write( entry ) out_file.close() config = ConfigParser() config.read( 'idea_watch.config' ) f = urllib.urlopen( config.defaults()['url'] ) html = f.read() pattern = '