Example #1
0
    def crawling(self, store):

        self.store = store

        if self.store == "App Store":
            self.history = History(f"{self.app_name}_app_store")
            self.crawler = AppStoreCrawler(self.app_id, self.history.history_list)
        elif self.store == "Google Play":
            self.history = History(f"{self.app_name}_google_play")
            self.crawler = GooglePlayCrawler(self.package_name, self.history.history_list)

        self.new_reviews = self.crawler.crawling()
        print(f"➤ {self.store} - Get {len(self.new_reviews)} new comment !")

        new_reviews_id = [review['id'] for review in self.new_reviews]
        self.history.history_list = new_reviews_id + self.history.history_list
Example #2
0
    def clear_cache(self):
        cache_files = []

        for table in ['photoframe', 'screensaver']:
            recents = History(table).get(10)
            cache_files += [photo[1].replace('/', '_') for photo in recents]

        all_caches = cache_files + ['thumb_' + file for file in cache_files]

        for fullpath in glob.iglob(os.path.join(CACHE_DIR, '*')):
            filename = os.path.basename(fullpath).decode('utf-8')
            if filename not in all_caches:
                os.remove(fullpath)
Example #3
0
    def __init__(self, root):
        """
        Constructeur

        :param root: Fenetre racine

        :type root: Tk
        """
        super().__init__(root)
        self.setup_frame()

        self.build_title()
        self.m_algorithms_list = self.build_algorithms_list()
        self.m_heuristics_list = self.build_heuristics_list()
        self.m_options_list = self.build_options_list()
        self.m_message = self.build_message()
        self.m_start_button = self.build_start_button()
        self.m_reset_button = self.build_reset_button()

        self.m_event_manager = MenuEventManager(self)

        self.m_history = History()
        self.m_history_interpreter = HistoryInterpreter(
            self.m_history, self.master.m_grid)
Example #4
0
@author: slarinier
'''

from actions import Actions
import argparse
from history.history import History
import sys
import threading

if __name__ == '__main__':
    scriptsJS = [
        'harvesting/googlesearch.js', 'harvesting/bingsearch.js',
        'harvesting/yahoosearch.js'
    ]
    h = History()
    result = []
    domaine_ip = {}

    # limit=sys.argv[4]

    parser = argparse.ArgumentParser(description='metaharvester')
    parser.add_argument('--db',
                        dest='db',
                        help='db in mongo to store informations')
    parser.add_argument('--geoloc', dest='geoloc')
    parser.add_argument('--action', dest='action')
    parser.add_argument('--criteria', dest='criteria')
    parser.add_argument('--collection', dest='collection')
    parser.add_argument('--attr', dest='attr')
    parser.add_argument('--threadpool', dest='threadpool')
Example #5
0
 def __init__(self, board_name, keywords):
     self.board_name = board_name
     self.keywords = keywords
     self.new_articles = None
     self.history = History(self.board_name)