Giter Site home page Giter Site logo

portrait's Introduction

portrait

Portrait is a web service which converts a website into a image. The actual hard work is handled by Google’s Puppeteer. Portrait is primarily designed to be used as a service, but does have a minimal admin interface.

Dependencies

You’ll need to be able to run Puppeteer via Node.js. You’ll also need to be able to run a Rails stack. Portrait is built on Ruby 2.3.3 and Rails 5.2

Installation

The provided setup script should take care of all the necessities: installing dependencies, setting up a database, and creating a temporary admin user.

$ ./bin/setup

Once that completes successfully, spin up a rails server

$ rails server

And visit localhost:3000

How it works

Send a POST request like below. Use basic http authorization and provide a parameter named site[url]. You can test it with curl:

curl -X POST -d "site[url]=https://google.com" -H "Accept: application/json" http://admin:admin@localhost:3000/sites

On a valid url, you’ll get a json response like this:

{
  "site": {
    "id": 1,
    "status": "succeeded",
    "image": {
      "url": ".../1.png"
    }
  }
}

Author

portrait's People

Contributors

jmckible avatar jakemunta 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.