Skip to content

Commit b485aa3

Browse files
committed
Version 1.0.0 adding new features
1 parent f61b8da commit b485aa3

File tree

7 files changed

+209
-66
lines changed

7 files changed

+209
-66
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,21 @@ Now you have two options: the **script with a User Interface** *(like a true sof
4242
> python3 cw-wizard.py -h
4343
```
4444
```text
45-
usage: CW Wizard [-h] [-v] -w wantlist_URLS [wantlist_URLS ...] [-m MAX_SELLERS] [-c]
45+
usage: CW Wizard [-h] [-v] -u WANTLIST_URLS [WANTLIST_URLS ...] [-m MAX_SELLERS] [-w] [-c]
4646
4747
CW Wizard, Find the best bundles for the cards in your wantlist(s).
4848
4949
optional arguments:
5050
-h, --help show this help message and exit
5151
-v, --version show program's version number and exit
52-
-w wantlist_URLS [wantlist_URLS ...], --wantlist-urls wantlist_URLS [wantlist_URLS ...]
52+
-u WANTLIST_URLS [WANTLIST_URLS ...], --wantlist-urls WANTLIST_URLS [WANTLIST_URLS ...]
5353
wantlist url(s) (if you pass multiples whislists, separate them with spaces)
5454
-m MAX_SELLERS, --max-sellers MAX_SELLERS
5555
maximum number of sellers to display on the result page
56-
-c, --continue-on-error
56+
-w, --continue-on-warning
5757
if specified the script will continue on non fatal errors
58+
-c, --articles-comment
59+
if specified the sellers comments will be added to the result page
5860
```
5961

6062
As you can see, you can call the script with one or more wantlist urls, and there is optional arguments available ([info on script arguments](https://github.com/BenSouchet/cw-wizard/blob/main/README.md#script-arguments)).
@@ -79,9 +81,20 @@ With the command line version of the script you can use the following arguments:
7981
|:-------------:|:-----------:|:--------:|
8082
| `-v` *OR* `--version` | Display the version number of the script in your terminal | No |
8183
| `-h` *OR* `--help` | Display the help in your terminal | No |
82-
| `-w` *OR* `--wantlist_urls` | One or more Cardmarket wantlists (wantlists) urls.<br />If you add multiple urls simply put a space between then (not a comma). | **Yes** |
83-
| `-m` *OR* `--max_sellers` | The maximum number of sellers to display on the result page.<br />Default value `20`. `0` means display all. | No |
84-
| `-c` *OR* `--continue_on_error` | Whatever to stop on non fatal requests errors.<br />Default value `False`. | No |
84+
| `-u` *OR* `--wantlist-urls` | One or more Cardmarket wantlists (wantlists) urls.<br />If you add multiple urls simply put a space between then (not a comma). | **Yes** |
85+
| `-m` *OR* `--max-sellers` | The maximum number of sellers to display on the result page.<br />Default value `20`. `0` means display all. | No |
86+
| `-w` *OR* `--continue-on-warning` | If specified the script won't stop on non fatal requests errors. | No |
87+
| `-c` *OR* `--articles-comment` |If specified the script will retrieve and add sellers comments to the result page. | No |
88+
89+
## Version
90+
Current version is `1.0.0`, you can download this latest release on the Releases category (on the sidebar), from [this page](https://github.com/BenSouchet/cw-wizard/releases) or `git clone` the `main` branch of the repository.
91+
92+
### Latest Version Changelog
93+
- Handle more than the 50 first articles for the card pages (see function [`load_more_articles()`]()).
94+
- Skip article and sellers that doesn't ship to your address.
95+
- Extract and display sellers comments for articles (if script argument `-c` is specified).
96+
- Add number or sales of the current seller when you display the cards list.
97+
- Minors code simplification.
8598

8699
## Sorting Relevant Sellers
87100
Currently the most relevant sellers are the ones with the most cards you are looking for in your wantlists.

assets/css/style.css

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,18 @@ a.seller-name:focus {
197197
}
198198
#popup-header {
199199
display: grid;
200-
grid-template-columns: 1fr auto;
200+
grid-template-columns: auto 1fr auto;
201201
place-items: start;
202+
gap: .8rem;
203+
padding-top: .2rem;
204+
}
205+
#popup-header .close-popup {
206+
line-height: 1em;
202207
}
203208
.card-item {
204209
width: 100%;
205210
display: grid;
206-
grid-template-columns: 34px 24px 1fr 66px 1px;/* Last column for the scrollbar */
211+
grid-template-columns: 34px 24px auto 1fr 66px 1px;/* Last column for the scrollbar */
207212
place-items: center start;
208213
gap: 0.8rem;
209214
padding: 2px 8px;
@@ -311,20 +316,33 @@ a.seller-name:focus {
311316
.card-item span:last-of-type {
312317
justify-self: end;
313318
}
319+
.card-item .card-comment {
320+
font-size: 0.9em;
321+
color: #a58155;
322+
overflow: hidden;
323+
text-overflow: ellipsis;
324+
white-space: nowrap;
325+
width: 100%;
326+
}
314327
#list-header {
315328
margin-top: .8rem;
316329
font-weight: 500;
317330
padding-bottom: .4rem;
318331
}
319332
#popup-seller-name {
320333
font-size: 1.4rem;
334+
line-height: 1.3em;
335+
align-self: end;
336+
}
337+
#popup-seller-sales-number {
338+
align-self: end;
321339
}
322340
#cards-list {
323341
display: grid;
324342
grid-auto-flow: row;
325343
overflow-y: scroll;
326344
color: #d3a164;
327-
height: calc(100vh - 116px);/* Yes, this an hardcoded value. Bad. Bad. Bad...*/
345+
max-height: calc(100vh - 116px);/* Yes, this an hardcoded value. Bad. Bad. Bad...*/
328346
}
329347
#outside-popup {
330348
position: fixed;

assets/js/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ function showCardsList(seller_id) {
2121
seller_link_popup_tag.href = seller_link_tag.href
2222
seller_link_popup_tag.innerText = seller_link_tag.innerText;
2323

24+
var seller_sales_number_tag = document.getElementById("seller-"+seller_id+"-sales-number");
25+
var seller_sales_popup_tag = document.getElementById("popup-seller-sales-number");
26+
if (!seller_sales_popup_tag) { return false; }
27+
seller_sales_popup_tag.innerText = '('+ seller_sales_number_tag.innerText + ' Sales)';
28+
2429
// Step 4: Block overflow body
2530
var body = document.querySelector("body");
2631
body.style.overflow = "hidden";
@@ -38,4 +43,6 @@ function closePopup() {
3843
// Step 2: Block overflow body
3944
var body = document.querySelector("body");
4045
body.style.overflow = "auto";
41-
}
46+
47+
return false;
48+
}

assets/template.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h4>Easily find the sellers with the most cards you are looking for!</h4>
1616
</header>
1717
<main id="main-content" role="main">
1818
<div id="wantlists" class="container">
19-
<h3>wantlist(s) you give to the Wizard:</h3>
19+
<h3>Wantlist(s) you give to the Wizard:</h3>
2020
<div id="wantlist-links" class="grid-items">
2121
</div>
2222
</div>
@@ -30,12 +30,12 @@ <h2>Most Relevant Sellers (<span id="max-sellers-value"></span>):</h2>
3030
</div>
3131
<div id="popup-container" class="hidden">
3232
<div id="popup-modal">
33-
<div id="popup-header"><a href="#" id="popup-seller-name" class="seller-name" target="_blank" rel="noopener noreferrer"></a><a href="#" onclick="closePopup(); return false;" title="Close the popup.">Close</a></div>
34-
<div id="list-header" class="card-item"><span></span><span></span><span>Card Name</span><span>Price</span></div>
33+
<div id="popup-header"><a href="#" id="popup-seller-name" class="seller-name" target="_blank" rel="noopener noreferrer"></a><span id="popup-seller-sales-number"></span><a class="close-popup" href="#" onclick="closePopup();" title="Close the popup.">Close</a></div>
34+
<div id="list-header" class="card-item"><span></span><span></span><span>Card Name</span><span></span><span>Price</span></div>
3535
<div id="cards-list">
3636
</div>
3737
</div>
38-
<a href="#" id="outside-popup" onclick="closePopup(); return false;"></a>
38+
<a href="#" id="outside-popup" onclick="closePopup();"></a>
3939
</div>
4040
</main>
4141
<script src="./assets/js/main.js"></script>

0 commit comments

Comments
 (0)