Git Product home page Git Product logo

kaigvilbig / checkleekduck Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 22 KB

A Simple web scraper to get Pokemon go events once a day using a chron job with rpm generation for RPM based Linux installations or .deb generatiosn for Debian based Linux distributions

TypeScript 46.12% Dockerfile 3.32% Batchfile 30.07% Shell 20.49%
debian docker linux-service mongodb mongoose rpm typescript centos9 ubuntu

checkleekduck's Introduction

Check Leek Duck Web Scraper

A Pokemon Go events monitor

  • Scrapes LeekDuck to get current and upcoming events on Pokemon Go
  • Stores the events in a MongoDB databse for use by other applications
  • Uses a Cronjob to execute once every day
    • Only fetch once a day as to not overwhelm LeekDuck
    • Only checking once a day is necessary since events aren't being announced every minute
  • Can be built as an RPM to install to RPM based Linux distributions
  • Can also be build as a Debian package to install on debian based distributions
  • RPMs and Deb packages will be built as a Linux Service and will run on boot and restart on failure
  • Uses Docker and CentOS to build the RPM
  • Uses Docker and Ubuntu to build the .deb
  • The /tests directory contains a test index.ts file for testing the building, installing, running and unsinstalling the RPM and Debian packages as a service

Building

  • To build the application for local use:
    • Clone the application
    • Run npm i to install required dependencies
  • To build an RPM to install on a Linux distribution:
    • Complete the steps listed above
    • Run the build.bat file
    • Once the RPM is build, it should be located in the /shared directory

Installing

  • To install the RPM:
    • Navigate to the directory containing the RPM package
    • Open a terminal
    • Run sudo dnf install leek-duck-0.0.1-1.el8.noarch.rpm
  • The above step should install the service as well as the required dependencies
  • To confirm the service is running:
    • Run systemctl status leek-duck

Running

  • To run the aplication in dev mode:
    • Run npm run dev to run in dev mode or,
    • Run ts-node index.ts

Rasberry Pi?

  • If you want to run this on a rasberyr pi the only way I found that works so far is:
    • use Rasberry Pi OS (Latest 64 bit)
    • curl -sSL https://get.docker.com | sh
    • mkdir mongodb (in /home/user/)
    • sudo docker pull mongo:4.4.13
    • sudo docker run --rm -d -p 27017:27017 -v ~/mongodb:/data/db --name mongodb mongo:4.4.13
    • To install .deb on RPi, Since the debian version < 12, zstd is needed to modify the .deb package.
      • ar x leek-duck_0.0.1_all.deb
      • zstd -d < control.tar.zst | xz > control.tar.xz
      • zstd -d < data.tar.zst | xz > data.tar.xz
      • ar -m -c -a sdsd /tmp/leek-duck_0.0.1_all.deb debian-binary control.tar.xz data.tar.xz
      • rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
      • apt-get install /tmp/some-package.deb
    • To run the docker image on boot:
      • First create your startup script @ /home/user/startup.sh, and make it executable:
        • #!/bin/bash
        • docker run --rm -d -p 27017:27017 -v ~/mongodb:/data/db --name mongodb mongo:4.4.13
      • chmod +x /home/user/startup.sh
      • Then set a crontab for it:
        • $ crontab -e
        • @reboot sudo /home/user/startup.sh

checkleekduck's People

Contributors

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