Skip to content

Latest commit

 

History

History
28 lines (25 loc) · 1.21 KB

File metadata and controls

28 lines (25 loc) · 1.21 KB

VK Post Text Parser

A Python script that uses the vk_api module to parse the texts of posts from a VKontakte page or group into .txt.

How to use?

  1. You will need Python 3.11 to run the scirpt, which you can download, for example here.
  2. Run the following command:
pip install vk_api
  1. Setup config.json.
  2. Run main.py:
python3 main.py
  1. The result output.txt will appear in the same directory as main.py.

Configuration file

The config.json configuration file is used to set the behavior of the program to suit the user's needs. It contains:

  • access_token: your access token to VK API methods;
  • domain: id of the VKontakte page or group;
  • post_number: number of posts to retrieve. If set to 0 all page's or group's post will be retrieved;
  • post_filter: post filter, which includes:
    • ad_allowed: boolean of whether the post can be promotional;
    • repost_allowed: boolean of whether the post can be a repost;
    • restricted_words: a list of banned words;

Contributing

This repository is open for contributing. So feel free to open issues and make pull requests.