eBay ID viewer for HobbyDB

show eBay IDs in listing

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         eBay ID viewer for HobbyDB
// @namespace    http://tampermonkey.net/
// @version      0.1
// @license      MIT
// @description  show eBay IDs in listing
// @author       Ryan
// @match        https://www.ebay.com/sch/*
// @icon         https://www.google.com/s2/favicons?domain=ebay.com
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
// @grant        none
/* globals $ */
// ==/UserScript==
(function() {
    //ebay changed shit
    //var item = '<div class="container">'
      var item = '<div class="s-item__wrapper clearfix">'
      //ebay changed to the above 9/28
      //var item = '<div class="results">'
    //ebay changed shit
    $( ".s-item__link" ).each(function(i, obj) {
      //$( ".vip" ).each(function(i, obj) {
       const regexp = /ebay.com\/itm\/([0-9]{12})\?(hash|epid)/g;
       const url = $(this).attr("href");
       const array = [...url.matchAll(regexp)];
       var itemnum = array[0]?.[1];
       item += array[0]?.[1]
       item += "<br />"
       $(this).after(`<p style="color:orange;font-size:120%">${itemnum}</p>`)
    })
    $(document.body).append(item);
})
();