Greasy Fork is available in English.

Amazon short URL

Replace article URL with short Amazon permalink

< Feedback on Amazon short URL

Review: قالتىس - قوليازما ئىشلەيدۇ

§
يوللانغان ۋاقتى: 2018-11-14
تەھرىرلەنگەن ۋاقتى: 2018-11-14

short url script but for eBay & ETSY ?

Hi! Congrats for this must-have script.
Are you able to create one for eBay & ETSY too ?

Only this workaround is available so far…

eBay copy short url button https://greasyfork.org/fr/scripts/17528-ebay-copy-short-url-button

All the best!

Graphenئاپتور
§
يوللانغان ۋاقتى: 2018-11-24
تەھرىرلەنگەن ۋاقتى: 2018-12-07

Hi Freshhh,

sorry for the delay. Just quickly made those for you, so they are not bulletproof. But should work. Let me know.

Try this for Ebay:

// ==UserScript==
// @name         eBay short url
// @namespace    graphen
// @version      1.2.0
// @description  Replaces long url by short url.
// @author       Ariel Jannai, graphen
// @include      /^https:\/\/www\.(be(fr|nl)\.)?ebay\.(at|ca|cn|vn|ie|it|nl|ph|pl|es|ch|de|fr|be|co\.(uk|th)|com(\.(au|hk|my|sg|tw))?)\/itm\/.*/
// @run-at       document-end
// @icon         https://cdn4.iconfinder.com/data/icons/flat-brand-logo-2/512/ebay-128.png
// @grant        none
// @license      MIT
// ==/UserScript==

/* jshint esversion: 6 */
(function(){
    'use strict';

    function tryShortUrl(url) {
        var urlPattern = /(be(fr|nl)\.)?ebay\.(at|ca|cn|vn|ie|it|nl|ph|pl|es|ch|de|fr|be|co\.(uk|th)|com(\.(au|hk|my|sg|tw))?)\/itm\//;

        if(urlPattern.test(url)) {
            var itmId = url.match(/\/(\d{12})(\?|$)/)[1];
            return 'https://www.' + urlPattern.exec(url)[0] + itmId;
        } else {
            return url;
        }
    }

    var url = String(window.location.href);
    history.replaceState(null, 'Shortened Ebay URL', tryShortUrl(url));

})();

Try this for Etsy:

// ==UserScript==
// @name         Etsy short url
// @namespace    graphen
// @version      1.1.0
// @description  Replaces long url by short url.
// @author       graphen
// @include      https://www.etsy.com/*
// @run-at       document-end
// @icon         https://www.etsy.com/images/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

/* jshint esversion: 6 */
(function(){
    'use strict';

    var itemId = document.getElementById("listing-image").getAttribute("data-palette-listing-id");

    if(itemId) {
        history.replaceState(null, 'Shortened Etsy URL', "https://www.etsy.com/listing/" + itemId);
    }

})();

Greetings, Graphen

§
يوللانغان ۋاقتى: 2018-12-06

Hi!

Thanks a lot for giving it a try. I really appreciate it a lot because those long eBay url are very annoying.

Unfortunately it does nothing.
Tested with eBay.com without luck, the link remains the same.

Could you please test and try to fix it?

And if it works please kindly add support for :

www.befr.ebay.be www.benl.ebay.be www.eBay.fr

Thanks!

Best,

Freshhh

§
يوللانغان ۋاقتى: 2018-12-06

Bummer... Same for Etsy, it does nothing… weird I wonder how it can works for you and not for me?

Graphenئاپتور
§
يوللانغان ۋاقتى: 2018-12-07

I don't know. Works perfectly for me. Firefox 63.0.3, latest Tampermonkey, Windows 10.

Modified ebay to support the three domains you mentioned.

§
يوللانغان ۋاقتى: 2018-12-07
تەھرىرلەنگەن ۋاقتى: 2018-12-07

Fantastic, the new eBay short URL universal script works wonders! Thank you so much, this will definitely be a lifesaving script for all users.

Just in case you don't mind adding all domains here is a full list: http://blog.linnworks.com/international-ebay-sites-list


About the ETSY script there is a little bug, currently shortened URL are transformed like this:

https://www.etsy.com/123456789/

but it must be formatted like this:

https://www.etsy.com/listing/123456789/

otherwise if you refresh the page there is a 404 not found error!

Graphenئاپتور
§
يوللانغان ۋاقتى: 2018-12-07

Thanks for the hints, both fixed. I put both scripts online now.

Etsy: https://greasyfork.org/scripts/375272 Ebay: https://greasyfork.org/scripts/375273

§
يوللانغان ۋاقتى: 2018-12-07

Tested and adopted. B)
BIG THANKS ! !

جاۋاب قايتۇرۇش

جاۋاب قايتۇرۇش ئۈچۈن كىرىش.