# -*- coding: UTF-8 -*- """Getting the URL information Id$ """ # Copyright 2008,2009 eGovMon # This program is distributed under the terms of the GNU General # Public License. # # This file is part of the eGovernment Monitoring # (eGovMon) # # eGovMon is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # eGovMon is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with eGovMon; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301 USA __author__ = "$Author$" __version__ = "$Revision$" __updated__ = "$LastChangedDate$" import urlparse urldata = [i.split() for i in open('urls').read().split('\n')] mailrecordurls = dict([(i[1],''.join(i[2:])) for i in urldata if i and i[0]=='Postliste']) notmailrecordurls = dict([(i[1],''.join(i[2:])) for i in urldata if i and i[0]=='Notpostliste']) def getURLInfo(type,domain): if type=='p':#Mail record record = mailrecordurls else: record = notmailrecordurls if domain in record.keys(): return urlparse.urlparse(record[domain])