Skip to content

Instantly share code, notes, and snippets.

@gbaman
Last active November 21, 2019 09:58
Show Gist options
  • Save gbaman/c16e953eced6821d66504dcef46b15c0 to your computer and use it in GitHub Desktop.
Save gbaman/c16e953eced6821d66504dcef46b15c0 to your computer and use it in GitHub Desktop.

Revisions

  1. gbaman revised this gist Nov 21, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Created with https://caiorss.github.io/bookmarklet-maker/
  2. gbaman revised this gist Nov 20, 2019. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions publish_all.js
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,17 @@ function publisher(){
    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()
  3. gbaman revised this gist Nov 20, 2019. 1 changed file with 14 additions and 12 deletions.
    26 changes: 14 additions & 12 deletions publish_all.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,15 @@
    var arr = [], l = document.links;
    for(var i=0; i<l.length; i++) {
    arr.push(l[i].href);
    }
    function publisher(){
    var arr = [], l = document.links;
    for(var i=0; i<l.length; i++) {
    arr.push(l[i].href);
    }

    //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) ;
    }
    });
    //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) ;
    }
    });
    }
  4. gbaman created this gist Nov 20, 2019.
    13 changes: 13 additions & 0 deletions publish_all.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    var arr = [], l = document.links;
    for(var i=0; i<l.length; i++) {
    arr.push(l[i].href);
    }

    //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) ;
    }
    });