Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.