Пример #1
0
from collect import crawler
from analysis import analizer
from visualize import visualizer

pagename = "jtbcnews"
from_date = "2018-05-01"
to_date = "2018-05-24"

if __name__ == "__main__":
    # postList = crawler.fb_get_post_list(pagename, from_date, to_date)
    # print(postList)

    dataString = analizer.json_to_str("D:/fb/jtbcnews.json", 'comments_str')
    count_data = analizer.count_wordfreq(dataString)
    print(count_data.most_common(20))  # most_common(20) 상위 20위까지만 표시하게끔 해줌

    # dictWords = dict(count_data.most_common(20))
    # visualizer.show_graph_bar(dictWords, pagename)

    dictWords = dict(count_data.most_common(20))
    visualizer.wordcloud(dictWords, pagename)
Пример #2
0
from collect import crawler as cr
from analysis import analizer as an
from visualize import visualizer as vi
import simplejson

pagename = "TheHeraldBusiness"
from_date = "2018-04-01"
to_date = "2018-05-29"

if __name__ == "__main__":

    #수집
    postList = cr.fb_get_post_list(pagename, from_date, to_date)
    print(postList)

    #분석
    dataString = an.json_to_str(
        "/Users/WOOSEUNGMI/Desktop/2018/javaStudy/facebook/TheHeraldBusiness.json",
        "message_str")  # 파일경로+경로명, key값(dic의)
    count_data = an.count_wordfreq(dataString)
    print(count_data)  #어떤 단어를 몇번 이용했는지 출력
    #리스트를 딕셔너리 형태로 변경
    dictWord = dict(count_data.most_common(20))  #단어 상위 몇개만 지정

    #그래프
    vi.show_graph_bar(dictWord, pagename)  #폰트네임알아내기

    # 워드크라우드
    vi.wordcloud(dictWord, pagename)
Пример #3
0
from analysis.analizer import json_to_str, count_wordfreq
from collect.crawler import fb_get_post_list
from visualize.visualizer import show_gragh_bar, word_cloud

pagename = "BlizzHeroesKR"
# pagename = "WarcraftKR"
# pagename = "BlizzardKR"
# pagename = "jtbcnews"
# pagename = "chosun"
from_date = "2016-10-10"
to_date = "2018-05-23"
file_path = "D:/Bigdata/facebook/%s.json" % pagename

if __name__ == '__main__':
    #수집
    fb_get_post_list(pagename, from_date, to_date)

    #분석
    data_string = json_to_str(file_path, "message_str")
    count_data = count_wordfreq(data_string)
    dict_word = dict(count_data.most_common(35))

    #그래프
    show_gragh_bar(dict_word, pagename)
    word_cloud(dict_word, pagename)
Пример #4
0
from collect import crawler
from analysis import analizer
from visualize import visualizer

pagename = "chosun"
from_date = "2018-02-09"
to_date = "2018-02-30"

if __name__ == "__main__":

    # 수집
    result = crawler.fb_get_post_list(pagename, from_date, to_date)
    print(result)

    # 분석
    dataString = analizer.json_to_str("D:\javaStudy/facebook/chosun.json",
                                      "message")
    # print(dataString)
    dictWords = analizer.count_wordfreq(dataString)
    #count_data = analizer.count_wordfreq(dataString)
    #print(count_data)
    #dictWords = dict(count_data.most_common(20))
    print(type(dictWords))
    print(dictWords)
    # 그래프
    visualizer.show_graph_bar(dictWords, pagename)
    visualizer.wordcloud(dictWords, pagename)