Conversation
Add a `set-country <code>` command (at/de) that switches the API endpoint between marktguru.at and marktguru.de. The login command also uses the configured country so the extracted API key matches the correct domain. Defaults to "at" for backward compatibility.
feat: add country selection for AT/DE support
Author
|
Would you consider merging this PR @manmal? |
…udondan/marktguru-cli (#2) Release-As: 1.0.0
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Schroeder <udondan@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Schroeder <udondan@users.noreply.github.com>
Same setup as cdk-ec2-key-pair: typescript-eslint with type-checked and stylistic rules, prettier enforced through eslint, and a Makefile that CI calls. The config is ported to ESM, since this package is type: module. Rule exceptions: quoted object properties keep their case (HTTP headers), variables may be PascalCase (class from a dynamic import), and prefer-nullish-coalescing ignores strings and numbers, where `||` is meant to catch empty values too. Fixes the type-aware findings: JSON.parse and response.json() are typed instead of any, commander action handlers get typed parameters, the two floating search promises are awaited via parseAsync, and fetchFirstOk rethrows an Error rather than an unknown.
The version passed to commander was hardcoded, so the CLI would keep reporting 0.1.0 after any release. Annotate the line with x-release-please-version and list src/cli.ts as an extra-file, so release-please bumps it along with package.json.
The test workflow relied on setup-node's cache, which never matched the cache directory make install writes to (--cache .npm), so every run started cold. Cache .npm explicitly, like cdk-ec2-key-pair does. Also adds the concurrency group and bash shell defaults from the same reference setup, and stops Renovate from automerging major updates.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Author
|
Heads-up for anyone finding this PR: since there's been no response here since May, I've published a maintained fork as It carries the AT/DE country selection from this PR plus a few fixes on top: @manmal this PR is opened from my fork's The country selection itself still works fine — if you ever want it upstream, just say so here and I'll open a fresh PR with only that change. |
* chore: drop header-generator dependency The marktguru site serves identical responses with static headers, so generated browser fingerprints add nothing. Removing it also drops the deprecated lodash.isequal (via ow@0.28) that warned on install. Release-As: 1.0.1 * test: add live end-to-end tests for login and search Runs the built CLI against marktguru.at and marktguru.de with an isolated HOME, so search has to auto-login by scraping. Catches the scraper breaking when Marktguru ships a new frontend.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set-country <code>command to switch betweenat(default) anddeapi.marktguru.at/api.marktguru.de)loginuses the configured country to extract the correct country-specific API key~/.marktguru/config.jsonand shown inconfigoutputatfor full backward compatibilityUsage
marktguru set-country de marktguru login marktguru set-zip 10115 marktguru search raw "milch"