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

[AmazonProduct] Shorten links even more #168

Closed
felixschndr opened this issue May 15, 2023 · 21 comments · Fixed by #180
Closed

[AmazonProduct] Shorten links even more #168

felixschndr opened this issue May 15, 2023 · 21 comments · Fixed by #180
Labels
feature New feature or request

Comments

@felixschndr
Copy link

Hey there! I love your work, really appreciate it =)

I found something for the amazon product link shortener:

  • Input link: https://www.amazon.de/Xiaomi-Aktivit%C3%A4tstracker-Trainings-Puls%C3%BCberwachung-Akkulaufzeit/dp/B091G3FLL7/?_encoding=UTF8&pd_rd_w=xDcJP&pf_rd_p=bf172aca-3277-41f6-babb-6ce7fc34cf7f&pf_rd_r=ZC6FZ5G6W9K8DEZTPBYW&pd_rd_r=11b3ec4e-047c-4f37-8302-62dedb8f502b&pd_rd_wg=Ozi90&ref_=pd_gw_ci_mcx_mr_hp_atf_m
  • Gets converted to: https://www.amazon.de/Xiaomi-Aktivit%C3%A4tstracker-Trainings-Puls%C3%BCberwachung-Akkulaufzeit/dp/B091G3FLL7/ (which is good...)
  • ... But it can be shortened even more: https://www.amazon.de/dp/B091G3FLL7/. Only the /dp/ followed by the product id is a valid amazon link as well and in some cases (where the product title is long) can be much shorter

So this should be result shouldBe "https://www.amazon.de/dp/B091G3FLL7/"


Furthermore I think there might be a test missing for links from other countries like .co.uk (multiple dots)

@svenjacobs
Copy link
Owner

This will be available in the next release 😃

@felixschndr
Copy link
Author

Nice!

@TPS
Copy link

TPS commented May 28, 2023

Duplicates #160, but I'm glad it's fixed from here.

@serrq
Copy link

serrq commented Jun 4, 2023

This trick works also with amazon.it

@TPS
Copy link

TPS commented Jun 4, 2023

This trick works also with amazon.it

It frankly likely works across all of Amazon.[TLD]. @svenjacobs Is there a method setup for that sort of thing in Léon?

@svenjacobs
Copy link
Owner

This trick works also with amazon.it

It's frankly likely it works across all of Amazon.[TLD]. @svenjacobs Is there a method setup for that sort of thing in Léon?

Yes, the underlying regex is designed so that it works with all Amazon domains. @TPS What should the method set up?

@TPS
Copy link

TPS commented Jun 5, 2023

I meant something that could work across many TLDs, but the same owner & pattern (like Amazon's above or Google's).

@svenjacobs
Copy link
Owner

I meant something that could work across many TLDs, but the same owner & pattern (like Amazon's above or Google's).

@TPS I still don't understand, sorry 😉 When we write a sanitizer for a domain that is known to have multiple TLDs, we generally design the regex as such. I don't know if it makes sense to have an option that makes any TLDs available for all existing sanitizers?

@TPS
Copy link

TPS commented Jun 5, 2023

@TPS I still don't understand, sorry 😉 When we write a sanitizer for a domain that is known to have multiple TLDs, we generally design the regex as such.

This is what I was verifying, & whether that was done for, e.g., Amazon.[TLD], Google.[TLD], &c

I don't know if it makes sense to have an option that makes any TLDs available for all existing sanitizers?

No, certainly not generally, but, if turns out that existing/requested sanitizer needed to be written wide enough for Example.[TLD], I now know it could. Thanks! 🙇🏾‍♂️

@TPS

This comment was marked as off-topic.

@serrq

This comment was marked as off-topic.

@svenjacobs

This comment was marked as off-topic.

@serrq

This comment was marked as off-topic.

@svenjacobs

This comment was marked as off-topic.

@TPS

This comment was marked as off-topic.

@svenjacobs

This comment was marked as off-topic.

@TPS

This comment was marked as off-topic.

@TPS

This comment was marked as off-topic.

@svenjacobs

This comment was marked as off-topic.

@serrq

This comment was marked as off-topic.

@svenjacobs

This comment was marked as off-topic.

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

Successfully merging a pull request may close this issue.

4 participants