Giter Site home page Giter Site logo

vk_poster's Introduction

VK post publishing

Refers to: https://habr.com/ru/post/520860/

Installing the package from git

pip install git+https://github.com/snussik/vk_poster.git

Connect to VK API

  1. Create a Standalone app: https://vk.com/editapp?act=create
  2. In VK app settings https://vk.com/editapp use ID приложения of int type.
  3. Send request: https://oauth.vk.com/authorize?client_id=ID_приложения&scope=photos,wall,offline&redirect_uri=http://api.vk.com/blank.html&response_type=token & go to link.
  4. In page url copy the TOKEN: https://api.vk.com/blank.html#access_token=TOKEN&expires_in=0&user_id=9999999.
  5. Get group address club123456.
  6. Create settings.py:
{
    "vk_ap_id" : ID_приложения,
    "token" : "TOKEN",
    "group" : "club123456",
    "v" :  5.122
}
  1. Use like this:
from vk_poster import VK
from settings import settings

if __name__ == "__main__":
    vk = VK(settings["token"], settings["v"], settings["group"])
    ph_path = './image.jpg'

    post_id = vk.quene_msg(photo=ph_path)

    if post_id != -1:
        print(post_id)
    else:
        print('Post error')

vk_poster's People

Contributors

snussik avatar

Watchers

James Cloos avatar  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.