GithubHelp home page GithubHelp logo

rulen111 / vkcc-auto Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 113 KB

Tiny flask application for automated link shortening via vk.cc service.

License: MIT License

Python 76.97% CSS 6.90% HTML 16.13%
flask vk-api

vkcc-auto's Introduction

VKcc Auto

Tiny flask application for automated link shortening via vk.cc service. Takes a .xlsx file with links and returns the same file but with shortened links alongside the old ones.

Installation

  1. Clone this repository:
    git clone https://github.com/rulen111/vkcc-auto.git

  2. Create virtual environment and install requirements:
    pip install -r requirements.txt

  3. Configure the application:
    Application's default settings can be found in ./vkcc_auto/config module. Since this application sends request to VK API, along with flask app's SECRET_KEY user must provide a valid VK API access token of any type. One way to do that is to create a separate config file with app's secret key and an access token (i.e. my_config.cfg) and set an environment variable VKCCAUTO_SETTINGS pointing to that file.
    Config file:

    SECRET_KEY = "<your secret key>"
    TOKEN = "<your access token>"
    

    Setting env variable:

    export VKCCAUTO_SETTINGS=/path/to/my_config.cfg
    
  4. Configure celery:
    This application uses Redis by default. Therefore, you need to have redis backend installed on your system in order to run this application. The easiest way is to use docker:

    docker run -d -p 6379:6379 redis
    

    You can use any compatible message broker, but make sure to change the celery configuration in ./vkcc_auto/config:

    CELERY = dict(
             broker_url="<your broker url>",
             result_backend="<your broker url>",
     )
    

How to use

  1. Make sure your app is configured
  2. Run celery backend:
    Startup your message broker (redis by default) and run the Celery worker server using ./make_celery.py:
    celery -A make_celery worker -l info -P solo
    
  3. Deploy application:
    Using flask built-in development server:
    flask --app vkcc_auto run
    
    Or using gunicorn:
    gunicorn -b 0.0.0.0:8000 -w 4 'vkcc_auto:create_app()'
    
  4. The application has only one page and it's pretty straightforward. Choose a .xlsx file with links, press SUBMIT button and wait for an output file download. Main page also provides a dynamic progress bar for tracking task progress.

application-index-pageapplication-progressapplication-error-flashing

vkcc-auto's People

Contributors

rulen111 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.