Git Product home page Git Product logo

vktgbot's Introduction

vktgbot

docker image

Telegram bot for automatic forwarding posts from VK to Telegram.

About

Python script to automatically repost from VK community pages to Telegram channels or chats. Once the script is set up and running, it will check for new posts in VK every N seconds using VK API and, if there are any, parse and send them to Telegram.

How to use the script

You can manually run the script with Python or Docker and leave it running in the background. Or you can set the script to run automatically on the remote server with tools like crontab, systemd, etc. Or you can configure the script to run at one time if you set VAR_SINGLE_START = True in .env file.

Installation

# clone the repository
$ git clone https://github.com/alcortazzo/vktgbot.git

# if you want to clone specific version (for example v2.6)
$ git clone -b v2.6 https://github.com/alcortazzo/vktgbot.git

# change the working directory to vktgbot
$ cd vktgbot

Note that in version 3.0 the script has been rewritten from the pyTelegramBotAPI library to the aiogram library. So if you want to install an older version of the script working with the pyTelegramBotAPI library, install version 2.6 using the method above. You can find instructions on how to run an older version of the script here.

Configuring

Open .env configuration file with text editor and set the following variables:

VAR_TG_CHANNEL = @aaaa
VAR_TG_BOT_TOKEN = 1234567890:AAA-AaA1aaa1AAaaAa1a1AAAAA-a1aa1-Aa
VAR_VK_TOKEN = 00a0a0ab00f0a0ab00f0a6ab0c00000b0f000f000f0a0ab0a00b000000dd00000000de0
VAR_VK_DOMAIN = bbbb
  • VAR_TG_CHANNEL is link or ID of Telegram channel. You must add bot to this channel as an administrator!
  • VAR_TG_BOT_TOKEN is token for your Telegram bot. You can get it here: BotFather.
  • VAR_VK_TOKEN is personal token for your VK profile. You can get it here: HowToGet.
  • VAR_VK_DOMAIN is part of the link (after vk.com/) to the VK channel. For example, if link is vk.com/durov, you should set VAR_VK_DOMAIN = durov.

Open the file "last_id.txt" and write in it the ID of the last message (not the pinned one!):

  • For example, if the link to post is https://vk.com/wall-22822305_1070803, then the id of that post will be 1070803.
  • Example photo

Running

Using Python

# install requirements
$ python3 -m pip install -r requirements.txt

# run script
$ python3 vktgbot

Using Docker

# change the working directory to docker
$ cd docker

# build and run docker
$ docker-compose up --build

License

GPLv3
Original Creator - alcortazzo

vktgbot's People

Contributors

alcortazzo avatar jargez avatar justice47 avatar petrarka avatar sandboiii avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.