Created with https://caiorss.github.io/bookmarklet-maker/
Last active
November 21, 2019 09:58
-
-
Save gbaman/c16e953eced6821d66504dcef46b15c0 to your computer and use it in GitHub Desktop.
Repl.it publish all activities
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
function publisher(){ | |
var arr = [], l = document.links; | |
for(var i=0; i<l.length; i++) { | |
arr.push(l[i].href); | |
} | |
var publish_count = 0; | |
//for (var url_checking in arr){ | |
arr.forEach(function (url_checking, index) { | |
if (url_checking.includes("teacher/assignments")){ | |
var split_url = url_checking.split("teacher/assignments/")[1].split("/edi")[0]; | |
var url_to_post = "https://repl.it/data/teacher/assignments/" + split_url + "/publish"; | |
$.post(url_to_post) ; | |
publish_count = publish_count + 1; | |
} | |
}); | |
alert("Published a total of " + publish_count + " activities") | |
location.reload(); | |
} | |
publisher() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment