예제 #1
0
파일: main.py 프로젝트: shadrus/YouTubeEye
def cmp_data(youtube_data):
    cmped_result = Result()
    db_data = get_data_from_file()
    cmped_result.likes_count = youtube_data.likes_count - db_data.likes_count
    cmped_result.dislikes_count = youtube_data.dislikes_count - db_data.dislikes_count
    cmped_result.comments = youtube_data.comments - db_data.comments
    cmped_result.subscribers = youtube_data.subscribers - db_data.subscribers
    cmped_result.view_count = youtube_data.view_count - db_data.view_count
    return cmped_result
예제 #2
0
파일: main.py 프로젝트: shadrus/YouTubeEye
def result_counter(result):
    final = Result()
    for item in result:
        for key, value in item.items():
            if key == 'viewCount':
                final.view_count += int(value)
            elif key == 'subscriberCount':
                final.subscribers = int(value)
            elif key == 'commentCount':
                final.comments += int(value)
            elif key == 'dislikeCount':
                final.dislikes_count += int(value)
            elif key == 'likeCount':
                final.likes_count += int(value)
    return final