Giter VIP home page Giter VIP logo

screeny's Introduction

Screeny

Simple docker container to take screen grab from website for greenminds project. It works in the following manner

  • Docker container runs a cron job every 20 mins
  • Using Python Selenium library and headless firefox/geckdriver scrape.py captures a given URL
  • Resultant png is converted to bmp and saved to /var/www/html
  • As Docker container is running standard apache2 this image (screengrab.bmp) is now available from the root of the container host i.e http://35.176.129.138/screengrab.bmp . The apache root in the docker image is /var/www/html

Requirements:

  • Public facing server that support Docker

Example installation on Amazon EC2 instance

  • Install Docker
  • clone/copy git code into folder
  • build docker image by running following command from root of folder docker build -t <your-tag-name> --no-cache .
  • run the docker container using following command ( setting it to forward port 80 on your host to port 80 in the container ) docker run -t -d -p 80:80
  • Check it's running docker ps - this should show the running process
  • browser to host URL/IP to download latest screengrab ( be mindful of your browser caching - perhaps adding a random querystring to the request might help )

Manually running scrape You can execute into the running docker container and manually run the scape

  • docker exec -it <name-of-container> bash ( you can get the name by running docker ps )
  • run python scrape.py to manually run

Example installation on ionos Ubuntu

  • Install Docker (https://docs.docker.com/engine/install/ubuntu/)
  • Install git 'apt-get install git'
  • clone/copy git code into folder
  • build docker image by running following command from root of folder docker build -t <your-tag-name> --no-cache .
  • run the docker container using following command ( setting it to forward port 7000 on your host to port 80 in the container ) docker run -t -d -p 7000:80
  • Check it's running docker ps - this should show the running process ( and show you the name of the container )
  • Update firewall rule to allow access over 7000
  • browser to host URL/IP:7000/screengrab.bmp to download latest screengrab ( be mindful of your browser caching - perhaps adding a random querystring to the request might help )

Manually running scrape You can execute into the running docker container and manually run the scape

  • docker exec -it <name-of-container> bash ( you can get the name by running docker ps )
  • run python scrape.py to manually run

screeny's People

Contributors

nmcilree avatar

Stargazers

Marcin Roszkowski 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.