Last active
April 20, 2020 22:33
-
-
Save mdtareque/7c7976281efb698d014fcb7443ae2aa9 to your computer and use it in GitHub Desktop.
tamper monkey script coding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name CF show lang | |
// @namespace mdtareque | |
// @version 0.4 | |
// @description try to take over the world! | |
// @author Md Tareque Khan | |
// @match https://codeforces.com/contest/*standings* | |
// @grant none | |
// ==/UserScript== | |
/* | |
0.1 : show languages on standing page | |
0.2 : delete 'GNU' part to reduce noise for c++ | |
0.3 : show languages during system testing | |
0.4 : handle locked submission | |
*/ | |
(function() { | |
'use strict'; | |
var getUpdatedTitle = function(lang) { | |
console.log("lang1 " + lang); | |
lang = lang.substring(lang.lastIndexOf(',')+2); | |
console.log("lang2 " + lang); | |
if(lang.startsWith("GNU")) | |
lang = lang.substring(4); | |
return lang; | |
}; | |
var updateNode = function(node) { | |
var oldText = node.children[1].innerHTML; | |
var lang = getUpdatedTitle(node.title); | |
node.children[1].innerHTML = oldText + " " + lang; | |
}; | |
$("[problemid][title] .cell-accepted").each(function() { | |
updateNode($(this).parent()[0]); | |
}); | |
$("[problemid][title] .cell-passed-system-test").each(function() { | |
updateNode($(this).parent()[0]); | |
}); | |
$("[problemid][title] .cell-accepted-locked").each(function() { | |
updateNode($(this).parent()[0]); | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name me download solution cj | |
// @namespace mtk | |
// @version 0.1 | |
// @description download solution cj | |
// @author You | |
// @match https://codingcompetitions.withgoogle.com/*/submissions/* | |
// @grant none | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
var addHtml = function() { | |
$('<style type="text/css"> \ | |
#mtk-download { \ | |
cursor: pointer; \ | |
position:fixed; \ | |
z-index: 10;\ | |
top: 200px;\ | |
right: 10px;\ | |
border: 1px solid black;\ | |
padding: 15px;\ | |
}\ | |
</style>\ | |
<button id="mtk-download">Download solutions</div>').appendTo('body'); | |
}; | |
addHtml(); | |
$("#mtk-download").click(function() { | |
console.log("Clicked download..."); | |
$(".download-button").each(function() { | |
var t = $(this); | |
console.log(t); | |
t.click(); | |
} ); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
codejam langs/user
eatmore, how you lewin - java
cakewalk, epic_time - python