diff --git a/noneroll.gs b/noneroll.gs index 945bb6e..b496c1e 100644 --- a/noneroll.gs +++ b/noneroll.gs @@ -62,9 +62,9 @@ function getEmails() { var rex = /.*?]*href=["'](https?:\/\/[^"']+)["'][^>]*>(.*?)<\/a>.*?/gi while(u = rex.exec(threads[i].getMessages()[0].getBody())){ if(u[0].toLowerCase().indexOf('unsubscribe')!==-1){ - for(var i = u.length-1; i >=0; i--){ - if(u[i].substring(0,4)=="http"){ - d.uns=u[i] + for(var j = u.length-1; j >=0; j--){ + if(u[j].substring(0,4)=="http"){ + d.uns=u[j] break } } @@ -74,9 +74,6 @@ function getEmails() { } } } - if(d.uns === null){ - Logger.log(d.subject) - } data.push(d) } else { break