def gen_wordcloud():
then = common_functions.queryrange(1)
body = '''{
"size" : 10000,
"query": {
"constant_score": {
"filter": {
"range": {
"epoch": {
"from": '''+then+'''
}
}
}
}
}
}'''
text = common_functions.pull_mailtext_24hrs(es, es_collection_name, body, keywords_list).lower()
print text
print
wc = WordCloud(background_color="white", max_words=40)
fileloc = "/home/pierre/es_email_intel/wordcloud.png"
try:
wc.generate(text)
wc.to_file(fileloc)
print 'Finished!'
return
except:
target = open(fileloc, 'w')
target.truncate()
target.close()
print 'Except!'
return
评论列表
文章目录