예제 #1
0
파일: injector.py 프로젝트: SNACES/core
    def get_injector_from_file(path: str):
        config = parse_from_file(path)
        injector = Injector(config)

        log_config = config.get("Logging", {})
        LoggerFactory.init_root_logger("snaces2.log")

        return injector
예제 #2
0
def download_local_neighbourhood(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadLocalNeighbourhoodActivity(config)
    activity.download_local_neighbourhood_by_screen_name(name)
예제 #3
0
def construct_social_graph(seed_id: str, params=None, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = ConstructSocialGraphActivity(config)
    activity.construct_social_graph(seed_id, params)
def download_local_neighbourhood_tweets(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadLocalNeighbourhoodTweetsActivity(config)
    activity.download_local_neighbourhood_tweets_by_user_id(name)
예제 #5
0
def process_tweet(id: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = ProcessTweetActivity(config)
    activity.process_tweet_by_id(id)
예제 #6
0
def download_user_tweets(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadUserTweetsActivity(config)
    activity.download_user_tweets_by_screen_name(args.name)
예제 #7
0
def download_tweets(num: int, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadTweetsActivity(config)
    activity.stream_random_tweets(num_tweets=num)