您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sorts eBay™ search results by popularity (number of times sold)
当前为
// ==UserScript== // @name Ebay™ Popularity Sort // @version 1.0 // @description Sorts eBay™ search results by popularity (number of times sold) // @author jomifepe // @icon https://www.ebay.com/favicon.ico // @require http://code.jquery.com/jquery-latest.min.js // @include https://www.ebay.com/sch/* // @namespace https://gf.qytechs.cn/users/192987 // ==/UserScript== /* This is a port from the eBay™ Popularity Sort chrome extension. Thanks to Elad Nava: https://github.com/eladnava/ebay-popularity-sort */ (function() { 'use strict'; // Wait for document to load $(document).ready(function () { // Array of search results var results = []; // Traverse search results $('ul.srp-results li.s-item, ul#ListViewInner li[listingid]').each(function () { // Convert to jQuery object var listing = $(this); // Default listing sold count to 0 var soldCount = 0; // Extract hotness text var hotnessText = listing.find('.s-item__itemHotness, .hotness-signal').text().replace(/,/g, ''); // Get sold count as integer soldCount = parseInt(hotnessText) || 0; // Count indicates number of users watching this item and not number of times sold? if (hotnessText.includes('watching')) { soldCount = 0; } // Count indicates a percentage discount and not number of times sold? if (hotnessText.includes('%')) { soldCount = 0; } // Add item sold count and listing itself results.push({ sold: soldCount, listing: listing }); // Delete element temporarily listing.remove(); }); // Sort all listings by sold count DESC results.sort(function (a, b) { return b.sold - a.sold; }); // Get search results parent list var ul = $('.srp-river-answer, #ListViewInner').first(); // Warn the user about the modified result order ul.append('<p>These search results have been modified by <b><a href="https://github.com/eladnava/ebay-popularity-sort" target="_blank">eBay™ Popularity Sort</a></b>.</p>'); // Re-add the sorted results results.forEach(function (item) { ul.append(item.listing); }); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址