Changeset 18109 for lang/python

Show
Ignore:
Timestamp:
08/23/08 13:13:33 (3 months ago)
Author:
showyou
Message:

crochet Aタグ除去

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/python/crochet/twitter3.py

    r17940 r18109  
    232232                regUserAndMessage = re.compile("<td class=\"content\">([\w\W]*?)</td>") 
    233233                regUser = re.compile("<a href=.*?>(.*?)</a>") 
    234                 regMessage = re.compile("<span class=\"entry-content\">([\w\W]*?)</span>") 
     234                regMessage= re.compile("<span class=\"entry-content\">([\w\W]*?)</span>") 
    235235                regTime = re.compile("<abbr class=\"[\w\W]*?\" title=\"([\w\W]*?)\">") 
     236                regATagBegin = re.compile("<a href=.*?>") 
     237 
    236238                str = str.replace("\t","") 
    237239                str = str.replace("\n","") 
     
    248250                        d2 = regMessage.search(c)        
    249251                        resultData['user'] = unicode(d1.group(1),'utf-8') 
    250                         resultData['message'] = unicode(d2.group(1),'utf-8') 
     252                        message = unicode(d2.group(1),'utf-8') 
     253                        message2 = regATagBegin.sub("",message) 
     254                        resultData['message'] = message2.replace("</a>","") 
    251255                        tm = regTime.search(aa) 
    252256                        resultData['time'] = tm.group(1)