Welcome to ECCIE, become a part of the fastest growing adult community. Take a minute & sign up!

Welcome to ECCIE - Sign up today!

Become a part of one of the fastest growing adult communities online. We have something for you, whether you’re a male member seeking out new friends or a new lady on the scene looking to take advantage of our many opportunities to network, make new friends, or connect with people. Join today & take part in lively discussions, take advantage of all the great features that attract hundreds of new daily members!

Go Premium

Go Back   ECCIE Worldwide > General Interest > Technical Questions
test
Technical Questions Even the most computer-savvy may have technical questions regarding navigation of the site. Ask it here! If you have an answer, be our guest! (For further assistance, contact your local moderator or see the "Emails to the Staff" post in the Questions for the Staff city forums)

Most Favorited Images
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
Most Liked Images
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
  • Thumb
Top Reviewers
cockalatte 649
MoneyManMatt 490
Still Looking 399
samcruz 399
Jon Bon 398
Harley Diablo 377
honest_abe 362
DFW_Ladies_Man 313
Chung Tran 288
lupegarland 287
nicemusic 285
Starscream66 282
You&Me 281
George Spelvin 270
sharkman29 256
Top Posters
DallasRain70819
biomed163644
Yssup Rider61234
gman4453344
LexusLover51038
offshoredrilling48794
WTF48267
pyramider46370
bambino43216
The_Waco_Kid37398
CryptKicker37228
Mokoa36497
Chung Tran36100
Still Looking35944
Mojojo33117

Reply
 
Thread Tools
Old 04-23-2021, 01:08 PM   #1
EquateMan
Lifetime Premium Access
 
Join Date: Jan 4, 2019
Location: Missouri
Posts: 182
Encounters: 12
Default STG Filtering GreaseMonkey script

This is a very early alpha release, but thought I'd see if anyone finds any value in it.
This was written and tested with Firefox / GreaseMonkey. It might also work in other browsers with TamperMonkey or ViolentMonkey.

So, there's a LOT of duplicates on STG. People that post multiple times a day, and lots of scams. Basically, it takes the gallery and groups the photos up by post, making it clear that multiple photos are part of the same post.

To the right of each set is an X. If you click that, it will register all the images in that row, and remove the current row and any other row that includes the same images. At the very bottom of the screen is a reset button to clear your filters, but otherwise they should persist.

To install, add the GreaseMonkey extension to FireFox. Then, left click the monkey face, and click "New User Script", and paste the following:

Code:
// ==UserScript==
// @name     Skip the Crap
// @author    EquateMan
// @version  1.0.0
// @grant       GM.setValue
// @grant       GM.getValue
// @grant                GM.listValues
// @grant                GM.deleteValue
// @match https://*.skipthegames.com/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// ==/UserScript==


var input=document.createElement("input");
input.type="button";
input.value="Reset all filters";
input.onclick = showAlert;
document.body.appendChild(input); 

function setKey(key)
{
  GM.setValue(key, true);
}

async function getKey(key)
{ 
  var result = await GM.getValue(key);
  return result;
}

async function showAlert()
{
  let keys = await GM.listValues();
  for (let key of keys) {
    GM.deleteValue(key);
  }
  alert("Filters reset. Refresh your browser.");
}


function filter() 
{  
  var filterId = this.id;
  filterRow(filterId);
}

function filterRow(filterId)
{
  
  $(".day-gallery").find("tr").each(function() { 
    if($(this).attr('id') == filterId) { 
      addRowToFilters($(this));
        filterAll();
    } 
  } );
}

function addRowToFilters(row)
{
  var links = row.children("a");
  for(var i = 0; i < links.length; i++) {
    var link = links.eq(i);
    var imageId = link.children("img").attr('src');
    setKey(imageId);
  }  
}

function filterAll()
{
  $(".day-gallery").each(function() {
    var rows = $(this).children("table").children("tbody").children("tr").each(function() {    
        var row = $(this);
        var images = row.children("a").children("img");
      
      for (var i = 0; i < images.length; i++) {
            var image = images.eq(i);
        getKey(image.attr('src')).then(function(filter) {
          if(filter) {
            $(row).remove();
          }
        });
      }
    });
  });
}

function hashImage(imageUrl)
{    //https://stackoverflow.com/questions/15208640/hashing-an-image-in-javascript
  var xhr = new XMLHttpRequest();
  xhr.open('GET', '/my/image/file.png', true);
  xhr.responseType = 'arraybuffer'; // this will accept the response as an ArrayBuffer
  xhr.onload = function(buffer) {
      var words = new Uint32Array(buffer),
          hex = '';
      for (var i = 0; i < words.length; i++) {
        hex += words.get(i).toString(16);  // this will convert it to a 4byte hex string
      }
      console.log(hex);
  };
  xhr.send();
}

var lastTitle;

//convert
$(".day-gallery").each(function() {
  
  var table = $("<table />");
  $(this).prepend(table);
  var row;
  var filterButton;
  
  var children = $(this).children();
  for (var i = 0; i < children.length; i++) {
    var currentChild = children.eq(i);
    
    var url = currentChild.attr('href');
    var title = currentChild.attr('title');
    var picUrl = currentChild.children("img").attr('src');

    if(title) {    // this filters to just the gallery links        
      if(title != lastTitle) { 
        
        row = $("<tr />");
        row.attr('id', url);
        table.append(row);
        
        filterButton = $("<input />");
        filterButton.attr('type', 'button');
        filterButton.attr('value', 'X');
        filterButton.attr('id', url);
        filterButton.click(filter);
        
        row.append(filterButton);
      }
      
      row.append(currentChild);
      
    }
    lastTitle = title;
  }
  
  filterAll();

});
EquateMan is offline   Quote
Old 05-06-2021, 11:22 PM   #2
morbidxrabs
Gaining Momentum
 
morbidxrabs's Avatar
 
Join Date: Sep 5, 2016
Location: Formerly Juaritos
Posts: 43
Default

Thanks! I can finally hide the obnoxious fake ads.
morbidxrabs is online now   Quote
Reply



AMPReviews.net
Find Ladies
Hot Women

Powered by vBulletin®
Copyright © 2009 - 2016, ECCIE Worldwide, All Rights Reserved