Browse Source

add docker image with instructions on how to use

fix-broken-scrape
Jørgen Lien Sellæg 6 years ago
parent
commit
cfc6127f68
  1. 1
      .gitignore
  2. 23
      Dockerfile
  3. 20
      README.md
  4. 7
      scrape.sh

1
.gitignore vendored

@ -1,2 +1,3 @@
node_modules node_modules
*~ *~
*.log

23
Dockerfile

@ -0,0 +1,23 @@
FROM node:14.2-alpine
MAINTAINER Jørgen Sverre Lien Sellæg <jorgen@guut.org>
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN apk add --no-cache \
chromium \
bash \
imagemagick \
graphicsmagick \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
WORKDIR "/app"
USER node
COPY --chown=node:node ./scrape.sh /scrape.sh
CMD ["/scrape.sh"]

20
README.md

@ -1,4 +1,20 @@
# Kultar - event calendar # Facebook event scraper
A simple facebook event scraper written with puppeteer
## Introduction ## Introduction
This is an simple application that should scrape facebook events from kulturvarsel page on facebook
Please note that terms and condition apply from facebook and this should only be
used if written consent is provided by facebook. However it will work without.
## Usage
### Alpine docker image is provided
```sh
docker build --tag facebook-scraper .
docker run \
-v "$(pwd):/app" \
--cap-add SYS_ADMIN \
facebook-scraper
```

7
scrape.sh

@ -0,0 +1,7 @@
#!/bin/sh
if ! [ -d node_modules ]; then
yarn
fi
exec node scrape.js
Loading…
Cancel
Save