def testGetTextsFromartigosEtc(self): from TextGrabber import Parser pars = Parser() texts=pars.getTextsFromArtigosEtc("http://www.artigos.etc.br/feed") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextWebArtigo(self): from TextGrabber import Parser pars = Parser() texts=pars.getTextWebArtigo("http://www.webartigos.com/articlerss/cat/17/") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsFromCulinaria(self): from TextGrabber import Parser pars = Parser() texts= pars.getTextsFromCulinaria("http://feeds2.feedburner.com/CulinariaEReceitas") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsFromArtigosCom(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsFromArtigosCom("http://www.artigos.com/option,com_mtree/task,rss/type,new/Itemid,61/") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsFromGlobo(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsFromGlobo("http://oglobo.globo.com/rss/plantao.xml") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsFromCrondia(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsFromCrondia("http://crondia.blogspot.com/feeds/posts/default?alt=rss") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsFromUOL(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsFromUOL("http://feeds.folha.uol.com.br/esporte/rss091.xml") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsHoroscopo(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsHoroscopo("http://www.jornaldelondrina.com.br/horoscopo/") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetTextsArtigonal(self): from TextGrabber import Parser pars = Parser() texts = pars.getTextsFromArtigonal("http://www.artigonal.com/rss/") for text in texts: print "---------------------------------------------------" print "title:", text print "text:", texts[text]
def testGetHTML(self): from TextGrabber import Parser pars = Parser() html = pars._getHTML("http://perdu.com") self.assertEqual(html,"<html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2><strong><pre> * <----- vous êtes ici</pre></strong></body></html>\n")
def testhtml2text(self): from TextGrabber import Parser pars = Parser() text = pars._html2text("œ")
def testGetLinks(self): from TextGrabber import Parser pars = Parser() links = pars._getLinks("http://feedparser.org/docs/examples/atom10.xml") self.assertEqual(links,{u'First entry title': u'http://example.org/entry/3'})