-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Before installing make sure Google Chrome, chromedriver, python and pip installed and in PATH.
Install python and pip
sudo apt update
sudo apt install python3 python3-pip
Install Google Chrome
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
Install chromedriver
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
With paru:
paru python3 python3-pip google-chrome chromedriver
With yay:
yay -S python3 python3-pip google-chrome chromedriver
Open up a terminal and paste in the following and hit enter
git clone https://github.com/mikkelrask/tingfinder.git
cd tingfinder
chmod +x install.sh
./install.sh
This will install tingfinder and it's python dependencies through pip.
Download the latest standalone
version from the releases and follow the install instructions to that specific release. Note that the standalone is modified to look only in it's folder for both the data folder, and search agent CSV, and can therefor not be run by i.e cron.
- Unzip the release file
- Change your search terms in tingfinder/tingfinder.csv
- Install requirements
-
py -m pip install -r requirements.txt
- Run the script with python
-
py tingfinder/tingfinder.py
- Open up
config.yml
file located in the$HOME/.config/tingfinder
directory, in a text editor. (i.e withnano $HOME/.config/tingfinder.config.py
) - Fill out the fields in the dictionary with your
postal_code
andsearch_radius
to activate search radius. Defaults are set to Copenhagen, Denmark and a search radius of 100km. - Open the
search-agent.csv
located in the$HOME/.config/tingfinder
directory in a text editor. (i.e withnano $HOME/.config/tingfinder/search-agent.py
) - Put in all of your search terms and min/max price in the following format
"seach term",min-price-in-DKK,max-price-in-DKK
example:"star trek communicator",200,500
With the script correctly configured you can run the script manually simply by typing tingfinder.py
in a terminal. A search will start and show you the output in the terminal, and still push notifications if new lots are available.
If you want to save that output to a file instead, simply use *nix's builtin function for output redirection:
I.e: tingfinder.py > your-output-file.log
If you want to automate the process, you can do so with a so called "cron job". Cron is a service that is run in set intervals, and will execute the command you give it.
Cron is automatically installed on most systems - to see if you got it installed open up a terminal and type whereis cron
. If you got an output, you got cron.
Edit your cron jobs
- Type
crontab -e
in your terminal -
- This opens up the default cli-based text editor. This can be nano, vi(m) or similar depending on your system.
- Paste in following line accordingly
*/30 * * * * /usr/local/bin/tingfinder.py > /PATH-OF-YOUR-DESIRE/output.log
where PATH-OF-YOUR-DESIRE is the directory path to where you want to save your output file. - Save and exit accordingly. Cron should confirm with
-
crontab: installing new crontab.