├── .gitignore ├── Dockerfile ├── LICENSE ├── Pipfile ├── README.md ├── Vagrantfile ├── __init__.py ├── config.json.example ├── crawler.py ├── docker-compose.yml ├── mapping ├── datacenters.json ├── regions.json └── server_types.json ├── notifiers ├── __init__.py ├── base_notifier.py ├── email_notifier.py ├── file_notifier.py ├── freemobile_notifier.py ├── osx_notifier.py ├── popup_notifier.py ├── popup_pywin_notifier.py ├── pushbullet_notifier.py ├── pushover_notifier.py ├── smsapi_notifier.py ├── telegram_notifier.py └── xmpp_notifier.py └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | 3 | # vagrant 4 | .vagrant 5 | 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | env/ 16 | bin/ 17 | build/ 18 | develop-eggs/ 19 | dist/ 20 | eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | 30 | # Installer logs 31 | pip-log.txt 32 | pip-delete-this-directory.txt 33 | 34 | # Unit test / coverage reports 35 | htmlcov/ 36 | .tox/ 37 | .coverage 38 | .cache 39 | nosetests.xml 40 | coverage.xml 41 | 42 | # Translations 43 | *.mo 44 | 45 | # Mr Developer 46 | .mr.developer.cfg 47 | .project 48 | .pydevproject 49 | 50 | # Rope 51 | .ropeproject 52 | 53 | # Django stuff: 54 | *.log 55 | *.pot 56 | 57 | # Sphinx documentation 58 | docs/_build/ 59 | 60 | # Private files 61 | config.json 62 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3-onbuild 2 | CMD [ "python", "./crawler.py" ] 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Anton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | tornado = ">=4.0.0" 10 | chump = ">=1.5.0" 11 | python-telegram-bot = "*" 12 | 13 | [requires] 14 | python_version = "3.8" 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kimsufi/So-you-Start Avaliability Crawler 2 | ============================ 3 | 4 | > Crawler that will notify you when Kimsufi servers (or So-you-Start, or OVH) become available for purchase. 5 | 6 | 7 | 8 | git clone https://github.com/MA3STR0/kimsufi-crawler.git 9 | cd kimsufi-crawler 10 | cp config.json.example config.json 11 | vim config.json # edit config.json file to set up your nofitication preferences 12 | sudo pip install -r requirements.txt 13 | python crawler.py 14 | 15 | About 16 | ----- 17 | 18 | Dedicated servers on [Kimsufi](http://www.kimsufi.com) and [So you Start](http://www.soyoustart.com) have amazing prices, however they are always out of stock. This crawler will notify you as aoon as servers are available for purchase; it can send emails, show Mac OS notifications, open popup windows, or even trigger sms. Then hurry up, you have around 2 minutes to complete your order :) 19 | 20 | 21 | Set it up 22 | --------- 23 | 24 | **Runs on GNU/Linux, Mac and Widnows with Python 2.7+ or Python 3.4+** 25 | 26 | - Clone this repo (`git clone https://github.com/MA3STR0/kimsufi-crawler.git`) or download and unpack archive 27 | - Taking `config.json.example` as a template, create a file `config.json` and correct configuration according to your preferences: 28 | - `servers`: list of servers that should be tracked, eg `["KS-1", "KS-2 SSD", "GAME-2"]` etc. All supported server names can be found in mapping file [mapping/server_types.json](/mapping/server_types.json) as values) 29 | 30 | - `region`: desired location of server, `canada` or `europe` 31 | 32 | - `notifier`: notification mechanism, choose between: 33 | - `"email"`: default, requires additional email account settings 34 | - `"popup"`: simple popup window, platform-independent 35 | - `"popup_pywin"`: simple popup window, displays on top of all other windows (Windows only, requires pywin32 package) 36 | - `"osx"`: Mac OS-X desktop notifications (using terminal-notifier) 37 | - `"smsapi"`: sms through smsapi.pl gateway, requires account 38 | - `"xmpp"`: send jabber/xmpp message, requires account - needs xmpppy 39 | - `"pushover"`: send Pushover message, requires account - needs chump 40 | - `"pushbullet"`: send Pushbullet message, requires account - needs pushbullet 41 | - `"freemobile"`: sends sms to freemobile customer, requires account - needs requests 42 | - `"telegram"`: sends message to a Telegram chat - needs python-telegram-bot 43 | 44 | - `to_email`: your email to receive notifications 45 | - `from_email`: email account of the crawler. 46 | - `from_pwd`, `from_smtp_host`: smtp configuration of crawler email account 47 | - `xmpp_jid`, `xmpp_password`, `xmpp_recipient`, `xmpp_send_test`: xmpp configuration of sending jabber account 48 | - `pushover_application_id`, `pushover_user_id`: your Pushover configuration, messages are sent to all devices assigned to user 49 | - `pushover_priority`: priority of the notification to receive. -2 is lowest and 2 is highest 50 | - `pushbullet_apikey`: your Pushbullet API key, notification sent to all devices 51 | - `freemobile_username`: your freemobile login 52 | - `freemobile_key`: your freemobile sms notification key 53 | - `telegram_token`: full token you receive from BotFather after creating a bot 54 | - `telegram_chat_id`: chat id you want to receive the message in. Retrieve by following for example [this stackoverflow answer](https://stackoverflow.com/a/32572159) 55 | 56 | - Crawler runs on Python 2.7+ and Tornado framework 4.0+. Assuming that you already have Python/pip, just get Tornado and the notifier dependencies with `sudo pip install -r requirements.txt`. You can also set up virtualenv if you like. 57 | - Run with `python crawler.py`. If no error messages come, you're ready. 58 | - (optional) If your pip install command fails due to xmpppy being on pre-release version (eg. 0.5.0rc1) use: `sudo pip install --pre -r requirements.txt` 59 | - (optional) In case of problems with easygui installation on Ubuntu, you can get it also with `sudo apt-get install python-easygui` 60 | - (optional) It's a good idea to register an account on Kimsufi/OVH in advance; just pick any available server on www.kimsufi.com and sign up without paying. This way later you will only need to log in and enter payment details, which saves a lot of time. 61 | 62 | **Test everything** 63 | 64 | You may test the whole chain by setting some popular servers in your 65 | config.json, for example ["KS-3A", "KS-3B", "KS-2E"]. Since those are always 66 | available, you should receive a notification immediately. 67 | 68 | **Config check** 69 | 70 | Crawler makes an initial check of the config file during startup, so if you have any syntax errors or missing software dependencies - console logs will let you know. 71 | 72 | 73 | Advanced configuration 74 | ---------------------- 75 | 76 | You can add more options to the config.json if you need: 77 | 78 | - `"crawler_interval": 8` // overriding default periodic callback interval in seconds (should be more than 7.2 to avoid rate-limit) 79 | - `"request_timeout": 30` // http timeout for API requests. 80 | - `"from_smtp_port": 587` // use non-standard smtp port 81 | - `"use_starttls": true` // forcing encrypted SMTP session using TLS (true by default) 82 | - `"use_ssl": false` // forcing encrypted SMTP session using SSL (false by default) 83 | - `"from_user": "sender@domain.com"` // if smtp user is different from `from_email` 84 | 85 | **Versions** 86 | 87 | These instructions are based on Version 2 of the crawler. You can access last stable release of v1 by browsing through [release history](https://github.com/MA3STR0/kimsufi-crawler/releases) 88 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | V_NAME="kimsufi-crawler" 2 | 3 | Vagrant.configure(2) do |config| 4 | config.vm.box = "ubuntu/trusty64" 5 | 6 | config.ssh.forward_agent = true 7 | 8 | config.vm.network "public_network" 9 | 10 | config.vm.provision "shell", inline: $provision 11 | 12 | config.vm.hostname = V_NAME 13 | 14 | config.vm.provider "virtualbox" do |v| 15 | v.name = V_NAME 16 | v.memory = 2048 17 | end 18 | end 19 | 20 | $provision = <