Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Promo checker
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @author CalypsoToolz
- // @match https://shop.logicvapes.ru/checkout/cart/couponAjax?coupon_code=*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var num = random(1000, 9999);
- var checking = "";
- if(location.search.split('coupon_code=')[1]) {
- checking = location.search.split('coupon_code=')[1];
- }
- setTimeout(function() {
- if(document.body.innerText.indexOf("Неверный код купона") != -1) {
- window.location.href = "https://shop.logicvapes.ru/checkout/cart/couponAjax?coupon_code=Logicclub" + num;
- } else {
- alert("Founded promo: " + checking);
- }
- }, 500); // если инет слабоват - увеличить задержку
- function random(min, max) {
- var rand = min - 0.5 + Math.random() * (max - min + 1)
- rand = Math.round(rand);
- return rand;
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement