def main(): db = Database() db.create_table_soup() urls = db.soup_url() if len(urls) < 1: craw = crawl.WebCrawling("http://start.bg") craw.crawling() sh = ServersHistogram(crawl.to_his) else: sh = ServersHistogram(urls, limit=10) his = sh.get_histogram() ServersHistogram.save_fig(his)
def main(): # load_his = ServersHistogram.load_db() # ServersHistogram.print_stats(load_his) db = Database() db.create_table_soup() urls = db.soup_url() if len(urls) < 1: craw = crawl.WebCrawling("http://start.bg") craw.crawling() sh = ServersHistogram(crawl.to_his) else: sh = ServersHistogram(urls) his = sh.get_histogram() ServersHistogram.save_fig(his)
def save_uniqe_in_db(self, db_name): db = Database(db_name) db.create_table_soup() links = self.get_all_unique() db.insert_into_soup(links)