# coding=UTF-8 """ This information is used to track the changes following this format dd/mm/yy Author * changes * ... 10/09/04 kingson * merge code for ytht.net preview by cppgx 08/09/04 kingson * add this changelog information """ import fqterm, string import re, urllib """ get url from ytht """ def previewYTHT(lp): URL=fqterm.getURL(lp) if(URL=='' or URL==None): return if re.search('http://ytht.net/Ytht.Net' \ '(\S+)/con\?B=(\d+)&F=M\.(\d+)\.A', URL) != None: # ytht article URL print 'Analizing ytht article URL' f_con = urllib.urlopen(URL) con = f_con.read() f_con.close() m_con = re.search('src=\"http://162.105.31.(\d+)(/|:(\d+)/)' \ 'Ytht.Net/boards/(\d+)/M\.(\d+)\.A\+\d+\"', con) if m_con != None: URL1 = con[(m_con.start() + 5):(m_con.end() - 1)] print 'URL1 = %s' % URL1 f_con1 = urllib.urlopen(URL1) con1_lines = f_con1.readlines() f_con1.close() x = range(0, len(con1_lines)) for i in x: m_con1 = re.search('