Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name SUSH (Stream Hider)
- // @author fapka
- // @namespace fapkamaster@gmail.com
- // @description Ukrywa wybrane transmisje z listy ogólnej, według listy w skrypcie.
- // @include https://showup.tv/
- // @include https://showup.tv/?pc=HISGQ73N50D70
- // @version 1.9.69
- // @run-at document-end
- // @grant none
- // @noframes
- // ==/UserScript==
- var ref_int = 3; //Częstotliwość odświeżania statystyk (raz na 3 odświeżenia listy transmisji).
- var _users = ['BlowJobQueen', 'PIEPRZYCmiSIEchce', 'Nowozency', 'RichGirlAnn',
- 'mojezycie', 'esperansa21', 'bosestopyblondynki',
- 'wspolnezabawy327', 'DEMoni', 'lubi_czarnulki', 'FuckYouBitch', 'tinia', 'maredytka', 'ladypassion832', 'niunia232',
- ];
- var trans_counter = $('body > div.container.page__home > div.row.pageheader > div.large-6.columns.large-text-right > h4');
- var matches = trans_counter.text().match(/(\d[\d\.]*)/g);
- var number1 = Number(matches[0]);
- var number2 = Number(matches[1]);
- var con_stats = [number1, number2], allow_ref = 0;
- console.info && console.info('%c «%s» %c—— %c %s && to ignore: '+_users.length,
- 'background:#000000; color:#7ebe45', GM_info.script.name,
- 'background:#000000; color:dimgray',
- 'background:#3c424d; color:#ffffff', GM_info.script.version);
- heartbeat();
- function refreshStats(){
- allow_ref++;
- if ( allow_ref % ref_int == 0 )
- {
- $.ajax({
- type : "get",
- url : "https://showup.tv/site/trans_list/get_stats?pc=HISGQ73N50D70",
- dataType : "json",
- success : function(data) {
- //console.log(data)
- //let con1 = JSON.parse(data); //Zrób obiekt zamiast JSONa: connections: "6977" transmissions: 127
- var cont2 = Object.values(data); //Zrób Arraya zamiast obiektu: ["6977", 127]
- con_stats[1] = parseInt(cont2[0]);
- con_stats[0] = cont2[1];
- },
- //error:function(e){ console.error(e); }
- });
- }
- }
- function heartbeat() {
- //Kod ze starego SU:
- //var $streams = $('#transList .stream a.stream-overlay[href]'),
- var $streams = $('#streamList > li > a'),
- hiddens = [];
- $streams.each(function(i, e) {
- var url = e.getAttribute('href'),
- p = url.lastIndexOf('/'),
- streamer = (p >= 0) && url.substr(p + 1);
- if ( streamer && _users.indexOf(streamer) >= 0 ) {
- $(e).closest('.stream').remove();
- hiddens.push(streamer);
- }
- });
- if ( !$streams.length || hiddens.length > 0 ) {
- var text = '[SH] ' + $streams.length + ' streams';
- if ( hiddens.length > 0 )
- {
- refreshStats();
- var newtext = con_stats[0]+" transmisji i "+con_stats[1]+" oglądających, w tym "+hiddens.length+" ukrytych (z "+$streams.length+")";
- trans_counter.text(newtext);
- text += ' / ' + hiddens.length+ ' hidden (' +
- hiddens.sort((a, b) => a.localeCompare(b)).join(', ') + ')';
- //console.log(text);
- }
- }
- $('img.lazy').trigger('appear');
- }
- (function(open) {
- XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
- this.addEventListener('readystatechange', function(event) {
- if ( this.readyState === 4 &&
- (this.responseURL === 'https://showup.tv/site/trans_list/get_list/bottom' ||
- this.responseURL === 'https://showup.tv/site/trans_list/get_list/big') )
- setTimeout(heartbeat, 0);
- }, false);
- return open.apply(this, arguments);
- };
- })(XMLHttpRequest.prototype.open);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement