🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/10 16:48:06
🔄 下次更新时间:2026/01/10 17:48:06
手动刷新缓存

eBay™ Popularity Sort

Sorts eBay™ search results by popularity (number of times sold)

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name             eBay™ Popularity Sort
// @version          1.0.6
// @description      Sorts eBay™ search results by popularity (number of times sold)
// @author           jomifepe
// @license          Apache-2.0
// @icon             https://www.ebay.com/favicon.ico
// @require          http://code.jquery.com/jquery-latest.min.js
// @include          https://www.ebay.com/sch/*
// @namespace        https://jomifepe.github.io/
// @supportURL       https://github.com/jomifepe/userscripts/issues
// @homepage         https://github.com/jomifepe/userscripts/tree/main/ebay-popularity-sort
// @contributionURL  https://www.paypal.com/donate?hosted_button_id=JT2G5E5SM9C88
// ==/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, .s-item__authorized-seller')
        .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>eBay™ Popularity Sort</b>.</p>');

    // Re-add the sorted results
    results.forEach(function (item) {
      ul.append(item.listing);
    });
  });
})();