Skip to content

Instantly share code, notes, and snippets.

@Constaline
Created May 26, 2019 03:33
Show Gist options
  • Select an option

  • Save Constaline/4328e52c03dd5d21312bf7496cd24948 to your computer and use it in GitHub Desktop.

Select an option

Save Constaline/4328e52c03dd5d21312bf7496cd24948 to your computer and use it in GitHub Desktop.

Revisions

  1. Constaline created this gist May 26, 2019.
    34 changes: 34 additions & 0 deletions gdgxk.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    var urls=[];
    var url=$('.content-learning,.content-unstart').each(function () {
        var str;
        str=$(this).parent().attr('href');
        str=str.match(/\('(.+)'\)/)[1];
        urls.push(str);
    });
    var ifr=$('<iframe>');
    var PN=0;
    var PF=false;
    var KF=false;
    var bdy;
    var str='';
    var doc;
    ifr.attr('width','100%');
    ifr.attr('height','900px');
    $('body').prepend(ifr);
    doc=ifr[0].contentWindow.document;
    setInterval(function(){
       str=$(doc).find('.learnpercent').text();
        if(str.indexOf('完成')>0){
    PF=false;PN++;
        }
        if(PF || PN>urls.length) return;
        PF=true;
    ifr.attr('src',urls[PN]);
        setTimeout(function(){
          doc=ifr[0].contentWindow.document;
          $(doc).find('.prism-big-play-btn').click();
          ifr[0].contentWindow.getTimu=function(index){
            return false;
         }
        }, 5000);
    }, 7000);