Skip to content

Instantly share code, notes, and snippets.

@sensityy
Forked from sebastienvercammen/Code.gs
Created December 31, 2016 01:22
Show Gist options
  • Select an option

  • Save sensityy/fe527aea75fb340ea3f0dfda94512f08 to your computer and use it in GitHub Desktop.

Select an option

Save sensityy/fe527aea75fb340ea3f0dfda94512f08 to your computer and use it in GitHub Desktop.

Revisions

  1. @sebastienvercammen sebastienvercammen revised this gist Dec 15, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion autoverifier.js
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ function myFunction() {

    messages.forEach(function(msg) {
    var value = msg.getBody()
    .match(/Verify your email/m);
    .match(/verify your email/m);

    if(msg.isInInbox() && value) {
    var link = msg.getBody().match(/<a href="https:\/\/club.pokemon.com\/us\/pokemon-trainer-club\/activated\/([\w\d]+)"/);
  2. @sebastienvercammen sebastienvercammen revised this gist Aug 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion autoverifier.js
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ function myFunction() {
    var value = msg.getBody()
    .match(/Verify your email/m);

    if(value) {
    if(msg.isInInbox() && value) {
    var link = msg.getBody().match(/<a href="https:\/\/club.pokemon.com\/us\/pokemon-trainer-club\/activated\/([\w\d]+)"/);

    if(link) {
  3. @sebastienvercammen sebastienvercammen revised this gist Aug 3, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion autoverifier.js
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,11 @@ function myFunction() {

    if(link) {
    var url = 'https://club.pokemon.com/us/pokemon-trainer-club/activated/' + link[1];
    var status = UrlFetchApp.fetch(url).getResponseCode();
    var options = {
    "muteHttpExceptions": true
    };

    var status = UrlFetchApp.fetch(url, options).getResponseCode();
    Logger.log("[#] Verified (" + status + "): " + url);

    if(status == 200) {
  4. @sebastienvercammen sebastienvercammen renamed this gist Aug 3, 2016. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions gistfile1.js → autoverifier.js
    Original file line number Diff line number Diff line change
    @@ -38,11 +38,9 @@ function myFunction() {

    if(status == 200) {
    verified++;
    msg.markRead();

    if(moveToTrash) {
    msg.markRead();
    msg.moveToTrash();
    }
    if(moveToTrash) { msg.moveToTrash(); }
    }
    }
    }
  5. @sebastienvercammen sebastienvercammen revised this gist Aug 3, 2016. 1 changed file with 19 additions and 11 deletions.
    30 changes: 19 additions & 11 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@
    Automatically click all "Verify your email" links in the welcome e-mail from
    Nintendo Pokémon Trainer Club's signup e-mails.
    All verified e-mails will be moved to trash unless you set "moveToTrash" to false.
    How to use:
    1. Login to Gmail
    2. Go to https://script.google.com/
    @@ -13,28 +15,34 @@

    function myFunction() {
    var verified = 0;
    var moveToTrash = true;

    var threads = GmailApp.getInboxThreads();
    var threads = GmailApp.search('in:inbox subject:"Pokémon Trainer Club Activation"');
    Logger.log("Found " + threads.length + " threads.");

    threads.forEach(function(thread) {
    var messages = thread.getMessages();
    Logger.log("Found " + messages.length + " messages.");

    messages.forEach(function(msg) {
    if(msg.getSubject() === "Pokémon Trainer Club Activation") {
    var value = msg.getBody()
    .match(/Verify your email/m);
    var value = msg.getBody()
    .match(/Verify your email/m);

    if(value) {
    var link = msg.getBody().match(/<a href="https:\/\/club.pokemon.com\/us\/pokemon-trainer-club\/activated\/([\w\d]+)"/);

    if(value) {
    var link = msg.getBody().match(/<a href="https:\/\/club.pokemon.com\/us\/pokemon-trainer-club\/activated\/([\w\d]+)"/);
    if(link) {
    var url = 'https://club.pokemon.com/us/pokemon-trainer-club/activated/' + link[1];
    var status = UrlFetchApp.fetch(url).getResponseCode();
    Logger.log("[#] Verified (" + status + "): " + url);

    if(link) {
    var url = 'https://club.pokemon.com/us/pokemon-trainer-club/activated/' + link[1];
    var status = UrlFetchApp.fetch(url).getResponseCode();
    Logger.log("[#] Verified (" + status + "): " + url);
    if(status == 200) {
    verified++;

    if(status == 200) { verified++; }
    if(moveToTrash) {
    msg.markRead();
    msg.moveToTrash();
    }
    }
    }
    }
  6. @sebastienvercammen sebastienvercammen revised this gist Jul 29, 2016. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,16 @@
    /*
    Automatically click all "Verify your email" links in the welcome e-mail from
    Nintendo Pokémon Trainer Club's signup e-mails.
    How to use:
    1. Login to Gmail
    2. Go to https://script.google.com/
    3. Enter the code, save, run.
    4. Wait until fully completed, DO NOT LEAVE THE PAGE! (When finished, the text "running..." at the top will disappear.)
    5. Click View > Logs. At the bottom you'll see the total accounts verified.
    6. Enjoy
    */

    function myFunction() {
    var verified = 0;

  7. @sebastienvercammen sebastienvercammen renamed this gist Jul 29, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @sebastienvercammen sebastienvercammen created this gist Jul 29, 2016.
    32 changes: 32 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    function myFunction() {
    var verified = 0;

    var threads = GmailApp.getInboxThreads();
    Logger.log("Found " + threads.length + " threads.");

    threads.forEach(function(thread) {
    var messages = thread.getMessages();
    Logger.log("Found " + messages.length + " messages.");

    messages.forEach(function(msg) {
    if(msg.getSubject() === "Pokémon Trainer Club Activation") {
    var value = msg.getBody()
    .match(/Verify your email/m);

    if(value) {
    var link = msg.getBody().match(/<a href="https:\/\/club.pokemon.com\/us\/pokemon-trainer-club\/activated\/([\w\d]+)"/);

    if(link) {
    var url = 'https://club.pokemon.com/us/pokemon-trainer-club/activated/' + link[1];
    var status = UrlFetchApp.fetch(url).getResponseCode();
    Logger.log("[#] Verified (" + status + "): " + url);

    if(status == 200) { verified++; }
    }
    }
    }
    });
    });

    Logger.log("Completed " + verified + " verifications.");
    }