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.
18
+
On Mac for example run:
19
+
```
20
+
brew install geckodriver
21
+
```
17
22
- 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)
20
23
- Run `python buyKim.py`
21
-
- ???
24
+
```
25
+
$ python buyKim.py --help
26
+
Usage: buyKim.py [OPTIONS]
27
+
28
+
Options:
29
+
-t, --timeout-conn INTEGER Maximum time in seconds to wait for webservice
30
+
answer. [default: 5]
31
+
-i, --interval FLOAT Minimum interval in seconds between two requests
32
+
[default: 7.5]
33
+
-f, --product-family TEXT The family of servers (ie. "Kimsufi"/"So you
34
+
Start") [default: Kimsufi]
35
+
-p, --ref-product TEXT Reference of the server (ie 1801sk12 for KS1,
36
+
1801sys29 for some soYouStart servers [default:
37
+
1801sk12]
38
+
-z, --ref-zones TEXT Data center short name(s) (ie "-z gra -z rbx
39
+
[default: gra, rbx, lon, fra]
40
+
--ovh-user TEXT
41
+
--ovh-pass TEXT
42
+
--debug / --no-debug Debug mode, disable by default. Add --debug flag
43
+
to enable
44
+
--help Show this message and exit.
45
+
```
22
46
- Profit!
23
47
24
48
# Architecture
25
49
26
50
The script is split in two parts:
27
51
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
52
+
- The first part uses `requests` to poll OVH's availability webservice,
53
+
and parses its response to find the product you want. When the response
30
54
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
55
+
- The second part uses `selenium` for opening the listing page, then selects
32
56
your product, injects some Angular.JS-specific JavaScript for selecting your
33
57
datacenter, waits for PayPal to load, and clicks on Purchase!
0 commit comments