Esempio n. 1
0
def main():

	RSS = rssfeed()
	RSSWebpage = webpage()

	RSS.setPatterns(["star formation", "star-formation", "Star formation", "Star Formation", "Star-Formation", "star-Formation", "starformation", "Starformation"])

	#RSS.getPapersTitle()
	RSS.getPapersSummary()
	Papers = RSS._summary_papers
	#RSS.getPapersKeyword()
	#Papers = RSS._keyword_papers

	for paper in Papers:
		RSSWebpage.addBody("<h3><b>%s</b></h3>" % paper["title"])
		RSSWebpage.addBody(paper["summary"])
		RSSWebpage.addBody(paper["author"])
		RSSWebpage.addBody(paper["link"], link=True)
		RSSWebpage.addBody("<hr><hr>")
		RSSWebpage.addBody("\n")

	if len(Papers)==0:
		print "Nothing Found"
		RSSWebpage.addBody("Nothing was found with pattern: %s" % (RSS._patterns))
	
	RSSWebpage.setTitle("arXiv feeds for: %s" % (RSS._date))
	RSSWebpage.buildPage("newfeeds_sfr.html")

	savename = "arxiv_feed_%s_%s.rss" % ("sfr", RSS._date)
	RSS.writeFeedToFile(savename)
Esempio n. 2
0
def main():

	RSSOldWebpage = webpage()

	# Load the RSS feed from file
	RSSfeeds = glob.glob('/home/user/workspace/journaltools/*sfr*.rss')
	print "Found feeds: %s" % (RSSfeeds)
	
	for RSSfilename in RSSfeeds:

		RSS = rssfeed()
		RSS.loadFeedFromFile(RSSfilename)
		print RSS._feed
		
		for paper in RSS._feed:
			RSSOldWebpage.addBody("<h3><b>%s</b></h3>" % paper["title"])
			RSSOldWebpage.addBody(paper["summary"])
			RSSOldWebpage.addBody(paper["link"], link=True)
			RSSOldWebpage.addBody("<hr><hr>")
			RSSOldWebpage.addBody("\n")
	
	RSSOldWebpage.setTitle("arXiv feeds for: %s" % (RSS._date))
	RSSOldWebpage.buildPage("oldfeeds_sfr.html")

	savename = "arxiv_feed_%s.rss" % ("sfrold")
	RSS.writeFeedToFile(savename)