GithubHelp home page GithubHelp logo

pciscoding / pass-fur-alle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonkpirateboy/pass-fur-alle

0.0 0.0 0.0 58 KB

Since Polisens web queueing solution for getting a passport sucks, and it is more or less impossible to book a time, I wrote this small python script. What it does is that it automates the searching for a bookable time. In the file you just change the constants to your information and away you go. :)

License: GNU General Public License v3.0

Python 100.00%

pass-fur-alle's Introduction

Pass für alle

Since Polisens web queueing solution for getting a passport sucks, and it is more or less impossible to book a time, I wrote this small python script. What it does is that it automates the searching for a bookable time. In the file you just change the constants to your information and away you go. :) More or less.

Settings

In the script there are some constainst that you need to change, they are found under the comment # Constants

Start searching today.

If you want to start some other day, just change this to a date with the format YYYY-MM-DD

startBookingDate = datetime.today().strftime('%Y-%m-%d')

The last date you want to search for

endBookingDate = "2022-05-25"

First available time

Some say faster, some say slower. But a good addition nevertheless. If you want to look for the first date using "First available time", change to True. Added by @granstubbe

firstDate = False

Your first name

firstName = 'Test'

Your last name

lastName = 'Testsson'

Your email

emailAddress = '[email protected]'

Your phone number

phoneNumber = '076127567'

Manual verify

Change this to False if you want the script to automatically book the time in the last step (recommended)

manualVerify = True

Instructions for MacOS, Linux and Windows

Prerequisites

What you need for running on MacOS

  • Google Chrome
  • Homebrew
  • Python 3
  • Selenium
  • Chromedriver

Install Google Chrome

Go to https://www.google.com/chrome/ and follow the instructions

Install homebew

Open a Terminal and enter

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Python 3

This should be pre installed on all macs, but you never know. Check by opening a Terminal and enter

`python3 --version``

If you get a response saying something like Python 3.x.x skip to Selenium

If you don't have Python 3 installed, open a Terminal and enter

brew install python3

Install Selenium

Open a Terminal and enter

pip3 install selenium

Install Chromedriver

Open a Terminal and enter

brew install chromedriver

Run the damn thing

Open a Terminal and go to the folder where you downloaded the script, probably Downloads/Pass-fur-alle-main, and you go there by entering cd Downloads/Pass-fur-alle-main Then enter: python3 pass-fur-alle.py

What you need for running on Linux

  • Google Chrome
  • PIP3
  • Selenium
  • Chromedriver

Install Google Chrome

Go to https://www.google.com/chrome/ and follow the instructions

Install PIP3

Open a Terminal and enter

sudo apt-get install python3-pip

Install Selenium

Open a Terminal and enter

pip3 install selenium

Install Chromedriver

Open a Terminal and enter

sudo apt-get install chromium-chromedriver or sudo apt-get install chromedriver

If your Linux doesn't have Chomedriver in apt, go to chromedriver.storage.googleapis.com and download a version compatible with your Chrome browser and extract the zip. Then run these commands:

sudo mv -f ~/Downloads/chromedriver /usr/local/share/

sudo chmod +x /usr/local/share/chromedriver

sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

Run the damn thing

Open a Terminal and go to the folder where you downloaded the script, probably Downloads/Pass-fur-alle-main, and you go there by entering cd Downloads/Pass-fur-alle-main Then enter: python3 pass-fur-alle.py

What you need for running on Windows

  • WSL2
  • X Server

Install X Server

Download and install VcXsrv in Windows. Launch it using the XLaunch utility or xlaunch.exe. Accept the default settings but check 'Disable access control'.

Install WSL2

Open an administrator PowerShell or Windows Command Prompt and run the folowing command:

wsl --install

This command will enable the required optional components, download the latest Linux kernel, set WSL 2 as your default, and install a Linux distribution for you (Ubuntu LTS by default).

Then type wsl to start a WSL2 session and follow the instructions for Linux.

Set the X DISPLAY

Finally enter the following command in the WSL2 terminal:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

Run the damn thing

In the WSL2 terminal go to the folder where you downloaded the script, probably Downloads/Pass-fur-alle-main, and you go there by entering cd Downloads/Pass-fur-alle-main Then enter: python3 pass-fur-alle.py

Other solution(s)

passport_booker_se by @elias123tre.

Glossary

Terminal

If you don't know what a terminal is; think of it as the thing you see on the news when something has been hacked, and there's a picture of someone in a hoodie is leaning over a computer? Or that time you saw Wargames, The Matrix, Mr Robot or even Hackers? That's the terminal. To find Terminal, open Launchpad and the folder Other and there it is. Or open Spotlight and type Terminal.

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.