Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Last active May 31, 2020 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepeviktor/8ede3e7e8830802be5a5c600c687ec2a to your computer and use it in GitHub Desktop.
Save szepeviktor/8ede3e7e8830802be5a5c600c687ec2a to your computer and use it in GitHub Desktop.
Netpincér NEM kedvelem gomb - https://i.imgur.com/M9uQlvr.png
// ==UserScript==
// @name Netpincér NEM kedvelem gomb
// @description Az étterem lista oldalakon megjelenít egy új gombot.
// @icon https://www.netpincer.hu/skin/flat/images/favicon.ico
// @version 0.1.3
// @grant none
// @require https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js
// @run-at document-idle
// @include https://www.netpincer.hu/hazhozszallitas/budapest*
// @include https://www.netpincer.hu/budapest*/hazhozszallitas
// @exclude https://www.netpincer.hu/*/_etlap
// @exclude https://www.netpincer.hu/*/etlap
// ==/UserScript==
$('.shop-list-row').each(function (_, shop) {
var shopCode = /.*\/(sh-[0-9a-f-]+)\/.*/.exec($(shop).find('.logo-container > img').data('src'))[1];
$(shop).find('.info-container .tags').append('<div class="utalom" style="float:right; border-color:#aaaaaa; color:#aaaaaa;">NEM kedvelem</div>');
$(shop).find('.info-container .tags .utalom').one('click', function (event) {
event.preventDefault();
event.stopImmediatePropagation();
$.ajax({url: 'https://www.netpincer.hu/utalom/' + shopCode + '/redir/L25lbS1rZWR2ZWxlbS1va2V0/format/ajax'})
.done(function () {
$(event.target).fadeOut();
})
.fail(function (data) {
console.error(data);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment