Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
 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)