Olx

Remove todas as cidades que não são BH

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Olx
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Remove todas as cidades que não são BH
// @author       Marcello Cavazza
// @match        https://www.olx.com.br/*
// @icon         https://upload.wikimedia.org/wikipedia/commons/b/b3/Logo_olx.png
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var button = document.createElement('button');

    button.textContent = 'Remover cidades';
    button.style.zIndex = '99999999';
    button.style.position = 'fixed';
    button.style.top = '20px';
    button.style.left = '20px';
    button.style.background = '#007bff';
    button.style.color = '#fff';
    button.style.border = 'none';
    button.style.padding = '10px 20px';
    button.style.borderRadius = '5px';
    button.style.cursor = 'pointer';

    document.body.appendChild(button);

    button.addEventListener('click', function () {
    console.log('starting olx cleaning script')
      const lojasGrid = document.getElementsByClassName('AdListing_gridLayout__DTjHC');

      lojasGrid[0].childNodes.forEach((loja) => {
          var lojaLocalizacao = loja.textContent.trim();
          
          if (lojaLocalizacao.toLowerCase().replaceAll(" ", "").indexOf("belohorizonte") == -1)
          {
            loja.style.display = 'none'
          }
      });
    console.log('ending olx cleaning script')
    });
})();