vitor Posted April 1, 2014 Share Posted April 1, 2014 (edited) Usage Remove UTM parameters, mobile subdomains, and other clutter from URLs via the Universal Action. Alternatively, configure the Hotkey to clean a selected URL or use the lc keyword to declutter the last copied URL. Redirects are followed before cleaning and the result is pasted to the frontmost app. ⤓ Install on the Alfred Gallery | Source Edited May 9 by vitor robgill, paulw and Chris Messina 2 1 Link to comment
vitor Posted April 21, 2014 Author Share Posted April 21, 2014 Update. It will no longer print a newline at the end. Link to comment
vitor Posted October 3, 2016 Author Share Posted October 3, 2016 Update. It now uses OneUpdater, so this should be the last time you need to manually update. Link to comment
vitor Posted October 4, 2016 Author Share Posted October 4, 2016 Updated to use the most recent version of OneUpdater (released today). Link to comment
vitor Posted December 29, 2016 Author Share Posted December 29, 2016 (edited) Update. Now handles ref= cases from Amazon. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Edited December 29, 2016 by vitor Link to comment
joeynotjoe Posted December 30, 2016 Share Posted December 30, 2016 Thank you! I spend my days dealing with Amazon and IMDB URLs, so this is seriously incredible. Link to comment
vitor Posted April 9, 2017 Author Share Posted April 9, 2017 Update. Now also deals with Facebook links. Also made some code cleaning and updated the icon. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
vitor Posted June 2, 2017 Author Share Posted June 2, 2017 Update. Generalize to remove everything after ?. I used to only do that case-by-case since there are legitimate uses for ? that change the page without being useless, but it seems like that maybe the minority. Trying it this way and maybe will add exceptions instead. Please let me know if any links break with this new rule. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
vitor Posted April 29, 2020 Author Share Posted April 29, 2020 Updates. Support Amazon Smile URLs. Always follow redirects. Use either your clipboard or input a URL. Cleaner code. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
vitor Posted August 31, 2020 Author Share Posted August 31, 2020 Update. Better handling of Amazon links, specifically searches. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
Voland Posted September 3, 2020 Share Posted September 3, 2020 I just installed it. On amazon.com works great, but on Amazon.de not so good, this is before and after (yes - they are the same): https://www.amazon.de/Nintendo-Switch-Konsole-Grau-2019/dp/B07W13KJZC?pf_rd_r=KZPSC02CKA27F12JWRPM&pf_rd_p=f6c987c2-74e9-4cb4-ac98-788b2ab13bdc&pd_rd_r=30ee7e3a-fde1-434b-b587-0c4b66921954&pd_rd_w=hn1Oq&pd_rd_wg=MLD3x&ref_=pd_gw_crs_zg_bs_300992 https://www.amazon.de/Nintendo-Switch-Konsole-Grau-2019/dp/B07W13KJZC?pf_rd_r=KZPSC02CKA27F12JWRPM&pf_rd_p=f6c987c2-74e9-4cb4-ac98-788b2ab13bdc&pd_rd_r=30ee7e3a-fde1-434b-b587-0c4b66921954&pd_rd_w=hn1Oq&pd_rd_wg=MLD3x&ref_=pd_gw_crs_zg_bs_300992 Link to comment
vitor Posted September 3, 2020 Author Share Posted September 3, 2020 5 hours ago, Voland said: On amazon.com works great, but on Amazon.de not so good It’s not related to the Amazon version, you just found another pattern they use. I’ve just released an update that will catch that and more. Voland 1 Link to comment
vitor Posted March 30, 2022 Author Share Posted March 30, 2022 Update. Added Universal Action, Hotkey, and External Trigger. Also, when getting a URL from the clipboard, it now gets the most recent one (text starting with http) from your clipboard history. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
heyJoeCampbell Posted March 18 Share Posted March 18 Hi @vitor I appreciate this workflow. I just discovered it not providing a clean url for Facebook links that are structured as such: https://www.facebook.com/events/875322786846832/875322793513498/?acontext={"event_action_history"%3A[{"mechanism"%3A"search_results"%2C"surface"%3A"bookmark_search"}]%2C"ref_notif_type"%3Anull} Link to comment
vitor Posted March 18 Author Share Posted March 18 @heyJoeCampbell I don’t use Facebook and they make it quite hard to check pages without an account. What would be the clean version on that URL? Link to comment
heyJoeCampbell Posted March 18 Share Posted March 18 That page can be accessed without an account. The clean version of the URL, be accomplished by removing: ?acontext=%7B"event_action_history"%3A[%7B"mechanism"%3A"search_results"%2C"surface"%3A"bookmark_search"%7D]%2C"ref_notif_type"%3Anull%7D Leaving the clean URL: https://www.facebook.com/events/875322786846832/875322793513498/ Link to comment
vitor Posted March 18 Author Share Posted March 18 31 minutes ago, heyJoeCampbell said: That page can be accessed without an account. Not for me. I can never access Facebook and Instagram links. Either way, the problem is the URL itself has characters which shouldn’t be there. This version takes care of that. Link to comment
dood Posted May 9 Share Posted May 9 Hi @vitor, it seems like the workflow has trouble processing URLs with special characters. In the following example, the letter "ê": https://www.amazon.com.br/Amêndoa-Crua-Sem-Casca-Naturais/dp/B0B8K34Q6T/ref=sr_1_3?keywords=amêndoas&qid=1683633872&sprefix=amêndoas,aps,257&sr=8-3 [09:04:45.245] ERROR: LinkClean[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:21:in `split': URI must be ascii only "https://www.amazon.com.br/Ame\u0302ndoa-Crua-Sem-Casca-Naturais/dp/B0B8K34Q6T/ref=sr_1_3?keywords=ame\u0302ndoas&qid=1683633872&sprefix=ame\u0302ndoas,aps,257&sr=8-3" (URI::InvalidURIError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse' from ~/Documents/Alfred Backup/Alfred.alfredpreferences/workflows/user.workflow.85C674D2-59BA-4C72-9F72-558B7E243773/linkclean_functions.rb:14:in `clean_url' from ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/81F8F0A2-2B58-4E6A-A27F-C29BF057A1B6:3:in `<main>' Link to comment
vitor Posted May 9 Author Share Posted May 9 Updated to 2023.1.Now on the Alfred Gallery.New repository.New icon.New About.Add configurable keyword.General URL cleaning improvements.Remove OneUpdater in favour of Gallery updating. sepulchra 1 Link to comment
dood Posted May 16 Share Posted May 16 Hi @vitor, getting an error on the following link: https://produto.mercadolivre.com.br/MLB-1526997661-garrafas-de-dispensador-de-sabo-montagem-da-parede-rodada-_JM?matt_tool=14372353&matt_word=&matt_source=google&matt_campaign_id=14302215552&matt_ad_group_id=134553706028&matt_match_type=&matt_network=g&matt_device=c&matt_creative=539425529212&matt_keyword=&matt_ad_position=&matt_ad_type=pla&matt_merchant_id=145336421&matt_product_id=MLB1526997661&matt_product_partition_id=1816389384366&matt_target_id=aud-2009166904988:pla-1816389384366 [18:23:32.167] ERROR: Link Clean[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:213:in `spawn': no implicit conversion of nil into String (TypeError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:213:in `popen_run' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:159:in `popen2' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/open3.rb:342:in `capture2' from ~/Documents/Alfred Backup/Alfred.alfredpreferences/workflows/user.workflow.85C674D2-59BA-4C72-9F72-558B7E243773/linkclean_functions.rb:7:in `follow_redirects' from ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/24729476-AB52-40DA-B4D6-492C2ED02142:3:in `<main>' Link to comment
vitor Posted May 16 Author Share Posted May 16 I can’t reproduce the error. Are you on version 2023.1 of the workflow? If so, what’s your Alfred and macOS versions? And how are you invoking the workflow (please give precise steps so I can try to reproduce). Link to comment
dood Posted May 17 Share Posted May 17 Doh, just realized I configured the hotkey to use the Selection in MacOS, rather than the clipboard (and I hadn't selected anything) 🤦♂️ Sorry about that! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now