- // ==UserScript==
- // @name Bot - supremenewyork
- // @version 1.0
- // @description try to take over the world!
- // @author You
- // @match *://www.supremenewyork.com/*
- // @grant none
- // ==/UserScript==
- var imie_i_nazwisko = 'Imie i nazwisko';
- var email = 'Email';
- var telefon = 'Telefon';
- var adres_1 = 'Adres';
- var adres_2 = '';
- var adres_3 = '';
- var miasto = 'Miasto';
- var kod_pocztowy = 'Kod pocztowy';
- var kraj = 'PL';
- var zapamietywanie_adresu = 1; // 0 lub 1
- var typ_karty = 'master'; // visa / american_express / master / solo / paypal
- var numer_karty = '5200 7413 5823 7283';
- var numer_miesiaca = '12';
- var numer_rok = '2017';
- var cvv = 'CVV';
- var link_do_produktow = 'http://www.supremenewyork.com/shop/all/pants';
- var kolor = 'Black'; // wielkość liter ma znaczenie
- var nazwa_produktu = 'Corduroy Work Pant'; // wielkość liter ma znaczenie, może być częściowa nazwa
- var pierwszy_rozmiar = '34';
- var drugi_rozmiar = 'Large';
- var godzina_rozpoczecia_godzina = 11;
- var godzina_rozpoczecia_minuty = 59;
- $(document).ready( function() { $('img').remove(); } );
- refreshIntervalId = setInterval(function(){
- if ( $( ".tab-confirmation.selected" ).length )
- {
- clearInterval(refreshIntervalId);
- return;
- }
- else if ( $( "#cart" ).is(':visible') )
- {
- window.location.replace("https://www.supremenewyork.com/checkout");
- clearInterval(refreshIntervalId);
- }
- else if ( $('[name=commit]').length && $('[name=commit]').val() == 'process payment')
- {
- $('#order_billing_name').val(imie_i_nazwisko);
- $('#order_email').val(email);
- $('#order_tel').val(telefon);
- $('input[name="order[billing_address]"]').val(adres_1);
- $('input[name="order[billing_address_2]"]').val(adres_2);
- $('input[name="order[billing_address_3]"]').val(adres_3);
- $('#order_billing_city').val(miasto);
- $('#order_billing_zip').val(kod_pocztowy);
- $('#order_billing_country').val(kraj);
- if (zapamietywanie_adresu)
- $('.iCheck-helper:first-child').click();
- $('#credit_card_type').val(typ_karty);
- $('input[name="credit_card[cnb]"]').val(numer_karty);
- $('#credit_card_month').val(numer_miesiaca);
- $('#credit_card_year').val(numer_rok);
- $('input[name="credit_card[vval]"]').val(cvv);
- $('.iCheck-helper:nth-child(2)').click();
- $('[name=commit]').click();
- clearInterval(refreshIntervalId);
- }
- else if ( $('[name=commit]').length && $('[name=commit]').val() == 'add to basket' )
- {
- if ($('#size option').filter(function () { return $(this).html() == pierwszy_rozmiar; }).val())
- {
- $("#size").val($('#size option').filter(function () { return $(this).html() == pierwszy_rozmiar; }).val());
- }
- else if ($('#size option').filter(function () { return $(this).html() == drugi_rozmiar; }).val())
- {
- $("#size").val($('#size option').filter(function () { return $(this).html() == drugi_rozmiar; }).val());
- }
- else // JEŚLI NIE MA ROZMIARÓW TO KOŃCZY DZIAŁANIE, MOŻNA WYWALIĆ TEGO ELSE TO KUPI PIERWSZY DOSTĘPNY ROZMIAR
- {
- clearInterval(refreshIntervalId);
- return ;
- }
- $('[name=commit]').click();
- }
- else if ( $('a:contains("' + nazwa_produktu + '")').length )
- {
- if (kolor == '')
- {
- window.location.replace("http://www.supremenewyork.com" + $( 'a:contains("' + nazwa_produktu + '")' ).attr('href'));
- }
- else
- {
- $( 'a:contains("' + nazwa_produktu + '")' ).each(function() {
- if ( $( this ).parent().parent().find( 'p > a:contains("' + kolor + '")' ).length )
- {
- window.location.replace("http://www.supremenewyork.com" + $( this ).parent().parent().find( 'p > a' ).attr('href'));
- }
- });
- }
- clearInterval(refreshIntervalId);
- }
- else if ( $('.sold-out').length )
- {
- clearInterval(refreshIntervalId);
- }
- else
- {
- var minuty = new Date().getMinutes();
- var godziny = new Date().getHours();
- if (((godziny == godzina_rozpoczecia_godzina) && (minuty >= godzina_rozpoczecia_minuty)) ||
- (godziny > godzina_rozpoczecia_godzina))
- {
- setInterval(function(){
- window.location.replace(link_do_produktow);
- }, 2000);
- clearInterval(refreshIntervalId);
- }
- }
- }, 100);