Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding click to handle arguments + small changes #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

arodrime
Copy link

Hello,

First of all, thanks for this work. I'll use it.

But before I made some changes to your script, mostly adding Click library to handle options. I'm sharing them so other people can make use it and with the hope that you will like the changes =).

I also:

  • allowed the script to look in multiple zones to improve chances to get a server.
  • changed the print a bit (using .format() and debug level INFO to see what's happening)
  • some more small stuff, including increasing versions dependency (selenium was not compatible with current firefox for example).

@arodrime arodrime force-pushed the add_click_library_for_arguments branch from dd176f2 to edc921e Compare January 25, 2019 01:27
@arodrime
Copy link
Author

  • Added payment and quantity option.
  • Configured default read timeout to handle disconnection / networks switch
  • Fixed contract checkboxes and validation button selectors (according to ks webpage early 2019)

@arodrime arodrime force-pushed the add_click_library_for_arguments branch from 0f2c193 to b854c70 Compare January 28, 2019 10:45
@PLNech
Copy link
Owner

PLNech commented Jun 6, 2020

Hi @arodrime, sorry I took so long to reply!

Thanks for the kind words and for sharing these improvements :)

As soon as I can review this I'll merge your branch, and in the meantime will mention it to other interested users 🚀

@PLNech PLNech mentioned this pull request Jun 6, 2020
@arodrime arodrime force-pushed the add_click_library_for_arguments branch 4 times, most recently from 3e72bdd to d5997c7 Compare November 14, 2020 03:04
@arodrime arodrime force-pushed the add_click_library_for_arguments branch from d5997c7 to 45274f3 Compare November 14, 2020 03:06
@arodrime
Copy link
Author

@PLNech I added today:

  • Handling the popup for cookies.
  • Handling selecting payment method
  • Updated API link to check availability

This script should work.

Tested with:

python3 buyKim.py --ovh-user <myemail> --ovh-pass <mypass> --ref-product 1801sk14 --debug
  • replace "1801sk14" by any available server for testing.
  • To really buy, remove the --debug option and pick the desired server.

More options?

BuyKim$ python3 buyKim.py --help
Usage: buyKim.py [OPTIONS]

Options:
  -t, --timeout-conn INTEGER      Maximum time in seconds to wait for
                                  webservice answer.  [default: 5]
  -i, --interval FLOAT            Minimum interval in seconds between two
                                  requests  [default: 7.5]
  --product-family TEXT           The family of servers (ie. "Kimsufi"/"So you
                                  Start")  [default: Kimsufi]
  -p, --ref-product TEXT          Reference of the server (ie 1801sk12 for
                                  KS1, 1801sys29 for some soYouStart servers
                                  [default: 1801sk12]
  -z, --ref-zones TEXT            Data center short name(s) (ie "-z gra -z
                                  rbx")  [default: gra, rbx, lon, fra]
  -q, --quantity INTEGER          Number of servers to rent - 1 to 5 (Maximum)
                                  [default: 1]
  -f, --payment-frequency INTEGER
                                  Receive the bill every 1,3,6 or 12 month
                                  [default: 1]
  --ovh-user TEXT
  --ovh-pass TEXT
  --debug / --no-debug            Debug mode, disable by default. Add --debug
                                  flag to enable
  --help                          Show this message and exit.

@piratack007
Copy link

Thnaks a lot 🥇

@PLNech
Copy link
Owner

PLNech commented Nov 16, 2020

Hey @arodrime, thanks that's great! I'll take some time during an evening this week to test it and finally merge this 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants