Skip to content

Instantly share code, notes, and snippets.

@Pierstoval
Last active August 8, 2019 15:14
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 Pierstoval/5d40bb409b23e49c6ea4dcdf5bc430e5 to your computer and use it in GitHub Desktop.
Save Pierstoval/5d40bb409b23e49c6ea4dcdf5bc430e5 to your computer and use it in GitHub Desktop.
Chrome snippets

My Chrome snippets

for(var i=0;i<3;i++){
setTimeout(function(){
// "Voir plus"
var list1 = document.querySelectorAll('a._5v47.fss');
if (list1.length) {
for (var i = 0, l=list1.length;i<l;i++){
list1[i].click();
}
}
// "{username} a répondu • X réponses"
var list2 = document.querySelectorAll('a.UFICommentLink');
if (list2.length) {
for (var i = 0, l=list2.length;i<l;i++){
var e = list2[i];
if (!e.querySelector('.UFIReplySocialSentenceLinkText').innerHTML.match(/Masquer \d+ r.{1,4}ponse/)) {
e.click();
}
}
}
// "Voir plus de réponses"
var list3 = document.querySelectorAll('a.UFIPagerLink');
if (list3.length) {
for (var i = 0, l=list3.length;i<l;i++){
var e = list3[i];
if (!e) { continue; }
e.click();
}
}
}, i * 1000);
}
var btnCueillir = $('.btnContent').filter(function(i,e){return e.innerText.match('Gather catnip');})[0];
var cueillirInterval = setInterval(function(){btnCueillir.click();}, 1);
var btnBois = $('.btnContent').filter(function(i,e){return e.innerText.match('Refine catnip');})[0];
var cueillirBoisInterval = setInterval(function(){btnBois.click();}, 1000);
(function(d, w){
var loggedInInterval = setInterval(function(){
var request = new XMLHttpRequest();
request.open('GET', window.location.href, true);
request.onload = function() {
if (this.status === 200) {
console.info('Seems I\'m still logged in 😃');
} else {
console.warn('Not logged in 😣 Server returned '+this.status);
}
};
request.onerror = function() {
console.warn('Not logged in 😣');
};
request.send();
}, 5000);
d.body.innerHTML = 'DONT CLOSE';
d.querySelector('title').innerHTML = 'DONT CLOSE';
d.body.style.fontSize = '128px';
w.loggedInInterval = loggedInInterval;
})(document, window);
(function(d){
var list=d.querySelectorAll('link');
for(var i=0, l=list.length;i<l;i++){
var e=list[i];
var h=list[i].href;
list[i].href="";
list[i].href=h;
}
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment