def getTistoryIdFromHTML(html): attr_dict = dict() attr_dict["tid"] = "livere_blogurl = '****.tistory.com';" attr_dict["tid2"] = """__addParam("author","****");""" ret_dict = findData(html, attr_dict) if "tid" in ret_dict: tistory_id = ret_dict["tid"] if len(tistory_id) > 0: return tistory_id elif "tid2" in ret_dict: tistory_id = ret_dict["tid2"] if len(tistory_id) > 0: return tistory_id return None
elif generator.lower().find("xpressengine") >= 0: blog_type = "xpressengine.com" return blog_type def getTistoryId(url): downLoader = Downloader() attr_dict = dict() attr_dict["tid"] = "livere_blogurl = '****.tistory.com';" attr_dict["tid2"] = """__addParam("author","****");""" try: (t_url, header, html) = downLoader.open(url) print "download", url except Exception, msg: getLogger().error("feed download error : %s %s", msg, rss) return None ret_dict = findData(html, attr_dict) if "tid" in ret_dict: tistory_id = ret_dict["tid"] if len(tistory_id) > 0: return tistory_id elif "tid2" in ret_dict: tistory_id = ret_dict["tid2"] if len(tistory_id) > 0: return tistory_id return None def getTistoryIdFromHTML(html): attr_dict = dict() attr_dict["tid"] = "livere_blogurl = '****.tistory.com';" attr_dict["tid2"] = """__addParam("author","****");"""