Giter Club home page Giter Club logo

screenshot-webpage-server's Introduction

screenshot-webpage-server

Screenshot webpages using phantomJS

NOTE : This api need node version >= 7

This Api uses

  • NodeJS ( version >= 7 )
  • Nodemon
  • PhantomJS ( For capturing webpage images )
  • Express ( For creating endpoint )
  • Pm2 ( For running application in production )

Get Started

Fire up your terminal

git clone https://github.com/manojsinghnegiwd/screenshot-webpage-server.git
cd screenshot-webpage-server
npm install
npm run dev

Your server is started on port 3000 in your browser go to

http://localhost:3000/screenshot?url=http://www.google.com

Put any url in place of http://www.google.com. You will get image as the response of the request. Checkout live version here http://www.manojsinghnegi.com/screenshot?url=http://www.manojsinghnegi.com

Query Params

  • url : Address of the webpage to take screenshot of
  • width : viewport width ( default is 1360 )
  • height : viewport height ( default is 768 )
  • format : default is raw can be change to base64

Response

You will get an image as the reponse of the request. Images will be saved in assets folder for future use and serverd at http://localhost:(port)/shots.

Scripts

  • npm run dev : start the server on port 3000
  • npm run prod : start the server on port 8080
  • npm run stop : stop the server when on production mode

Happy Coding

About Me

screenshot-webpage-server's People

Contributors

manojsinghnegiwd avatar

Stargazers

pavan avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

jsaddicts

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.