You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- One of the dependency is `Selenium` that depends on drivers: https://github.com/SeleniumHQ/selenium/blob/master/py/docs/source/index.rst#user-content-drivers.
19
+
20
+
On Mac to make this step easier, run:
21
+
```
22
+
brew install geckodriver
23
+
```
24
+
17
25
- Connect your OVH account to PayPal (this seemed the best option to avoid handling Credit Card data, but PR welcome if you want to do otherwise!)
18
-
- Set the environment variables `OVH_USERNAME` and `OVH_PASSWORD` (they are used to automate the purchase itself)
19
-
- Set `ref_product` to the product you want (default: `150sk22`) and `ref_zone` to the zone you want to rent it in (default: `bhs`, Beauharnois datacenter)
26
+
20
27
- Run `python buyKim.py`
21
-
- ???
28
+
```
29
+
$ python buyKim.py --help
30
+
Usage: buyKim.py [OPTIONS]
31
+
32
+
Options:
33
+
-t, --timeout-conn INTEGER Maximum time in seconds to wait for webservice
34
+
answer. [default: 5]
35
+
-i, --interval FLOAT Minimum interval in seconds between two requests
36
+
[default: 7.5]
37
+
-f, --product-family TEXT The family of servers (ie. "Kimsufi"/"So you
38
+
Start") [default: Kimsufi]
39
+
-p, --ref-product TEXT Reference of the server (ie 1801sk12 for KS1,
40
+
1801sys29 for some soYouStart servers [default:
41
+
1801sk12]
42
+
-z, --ref-zones TEXT Data center short name(s) (ie "-z gra -z rbx")
43
+
[default: gra, rbx, lon, fra]
44
+
--ovh-user TEXT
45
+
--ovh-pass TEXT
46
+
--debug / --no-debug Debug mode, disable by default. Add --debug flag
47
+
to enable
48
+
--help Show this message and exit.
49
+
```
50
+
22
51
- Profit!
23
52
24
53
# Architecture
25
54
26
55
The script is split in two parts:
27
56
28
-
- The first part uses `requests` to poll OVH's availability webservice,
29
-
and parses its response to find the product you want. When the response
57
+
- The first part uses `requests` to poll OVH's availability webservice,
58
+
and parses its response to find the product you want. When the response
30
59
describes your product as available, the second part of the script kicks in.
31
-
- The second part uses `selenium` for opening the listing page, then selects
60
+
- The second part uses `selenium` for opening the listing page, then selects
32
61
your product, injects some Angular.JS-specific JavaScript for selecting your
33
62
datacenter, waits for PayPal to load, and clicks on Purchase!
0 commit comments