Giter Site home page Giter Site logo

url2image's Introduction

Build Status Coverage Status License: MIT Documentation Status FOSSA Status

URL2Image

A microservice that turns an URL into an image.

What it is

URL2Image provides an API, which accepts a URL and returns a rendered image of the URL.

Installation

Either clone the repo and run it yourself:

git clone https://github.com/ImFlow/URL2Image.git

and then run it via:

docker build -t url2image .
docker run -d -p 5000:5000 url2image

or use the prebuild docker image:

docker pull imflow/url2image
docker run -d -p 5000:5000 url2image

there is also a docker-compose.yml file included so the service can be run using:

docker-compose up

How To Use

To download an url as a png file call the /getImage endpoint.

curl "localhost:5000/getImage?url=google.de" -o test.png

Supported options are url to specify the url of the target. This is required. width and height are optional parameters specifiing the image dimensions.

curl "localhost:5000/getImage?url=google.de&width=400&height=400" -o test.png

A basic login can be achieved via:

curl -H "Content-Type: application/json" -X POST -d '{"username":"user", "password":"url2image" }' "http://localhost:5000/login"
{
    "access_token": "TOKEN"
}

The authorization is then done in the header::

curl -H "Authorization: Bearer TOKEN" "http://localhost:5000/getImage?url=google.de"

Documentation

More documentation can be found here

Configuration

The service can be configured using environtment variables:

Variable  Description  Default Value
JWT_SECRET_KEY Secret key for the JWT access tokens Random String
JWT_USER The username for the JWT authentification "user"
JWT_PASSWORD The password for the JWT authentification "url2image"
FLASK_DEBUG Run in debug mode. Currently only disables the DDos protection not set
USE_LOGIN Enables the authorization requirement for the service  True
JWT_ACCESS_TOKEN_EXPIRES Expiration time of the JWT in seconds or False for no expiration  False

TODO

Design API

Provide API endpoints

DDos protection

JWT authentification

Username/Password authentification

Configs

✅ Image format selection (jpg/png)

  • Add a standalone Program

License

FOSSA Status

url2image's People

Contributors

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