Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TOKEN = "a68cd66fc736ce18468cfbdff7e342fd6a9c35b0cc9a5423d5738d264f10440b3c965b503d1970c435268"
- import vk_api
- from collections import Counter
- vk_session = vk_api.VkApi(token = TOKEN, app_id = 353179116)
- vk = vk_session.get_api()
- texts = []
- posts = vk.wall.get(domain="mudakoff", count=100)
- for post in posts['items']:
- comments = vk.wall.getComments(owner_id=post['owner_id'], post_id=post['id'], count=100)
- for comment in comments['items']:
- if 'text' in comment:
- texts.append(comment['text'])
- txt = ' '.join(texts)
- txt = txt.replace("\n", " ")
- txt = txt.replace(",", "").replace(".", "").replace("?", "").replace("!", "").replace("—", "").replace("-", "")
- txt = txt.lower()
- txt = txt.split()
- print(Counter(txt))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement