Jump to content
Sign in to follow this  
Followers 4
ChileHead

How to reformat incoming geocaching mail

Recommended Posts

A number of people would like a way of reformatting geocaching log email to get rid of some of the white space to make it easier to read on mobile.

 

If you use gmail for your email, I have a solution. This ends up using about 1/3 the vertical space. This all runs on google's servers, so the reformatting will work if you read your mail via web, desktop, or mobile. Even if you don't use gmail, you can use this solution with an extra couple steps involving forwarding, but I won't get into that because of the number of variables. The entire set up should take about 5-10 minutes. This effectively gives you a text or html option for your [LOG] emails.

 

Note: this is an unofficial solution of course. It works for me, but I take no responsibility for any deleted mail. I initially created the script 2 years ago or so and have used it off and on.

 

Setting up gmail:

  • In gmail (web interface) create a rule to tag all messages from "noreply@geocaching.com" with [LOG] with the label ToBeStripped. The actual label doesn't matter, as long as it's unique and matches what is in the script below. If you don't know how to set up a rule in gmail, it's pretty easy. In the search box just click the down arrow and follow the instructions.
  • Optional: in that same rule, click the checkbox for "archive (skip inbox)". This will prevent the original formatted log from showing up in your email when it first arrives. If you don't do this, the original will show and be replaced about a minute later with the reformatted one.
  • Try with the one rule using noreply@geocaching.com as the From, and [LOG] as the subject. If it works well for you then add another similar rule for "[GEO] Notify" as the subject to catch more. I tried this out and it works, but I've only tested it briefly.

 

Creating the script:


  •  
  • go here https://www.google.com/script/ and click start scripting
  • click File -> New Project
  • copy/paste the code below into the window. If you used a label other than "ToBeStripped", change it at the beginning of the script.
  • fill in your email address at the bottom.
  • save it
  • click the little icon that looks like a watch
  • click the link to add a trigger
  • under Run select process, under Events time-driven, select minutes timer, and every minute (feel free to change the frequency to anything you want)
  • click save
  • Somewhere in this process google will ask if the script you just created can access your mail. Say yes, or this doesn't work. :)

 

The script (copy/paste this as directed above):

function process() {
 var labelName="ToBeStripped";

 var label = GmailApp.getUserLabelByName(labelName);
 var threads = label.getThreads();

 for (var i=0; i<threads.length; i++)
 {
   var msgs = threads[i].getMessages();
   for (var m=0; m<msgs.length; m++)
   {
     var msg = msgs[m];

     if (! msg.isInTrash())
     {
       var body = msg.getBody();
       var subject = msg.getSubject();
       var textBody = "";       

       var lines = body.split("\n");
       for (var l=0; l<lines.length; l++)
       {
         var line = lines[l];
         if (line.indexOf("Logged by") != -1 ||
             line.indexOf("has a new log") != -1 ||
             line.indexOf("Log Type") != -1 ||
             line.indexOf("Date:") != -1 ||
             line.indexOf("Location:") != -1 ||
             line.indexOf("Name:") != -1 ||
             line.indexOf("Distance:") != -1 ||
             line.indexOf("Created by:") != -1 ||
             line.indexOf("Type:") != -1)
               textBody = textBody + line;
         else if (line.indexOf("Log</a>:</strong>") != -1)
           textBody = textBody + lines[l+1];
       }

       // textBody and htmlBody are the same for now, but both stripped down versions of the original
       GmailApp.sendEmail('YOUR_EMAIL_ADDRESS_HERE', subject, textBody, { htmlBody: textBody });  
       GmailApp.moveMessageToTrash(msg);
     }
   }
 }
};

 

What is all this doing:


  •  
  • your gmail filter applies the ToBeStripped label which is what the script uses to find emails to process. If you checked the "archive" checkbox, then the original emails will never show up in your inbox, but the script still finds them.
  • the script runs every minute, that's the fastest you can set it. So emails might take 1 minutes longer than normal. If you didn't select the "archive" checkbox, then the originals will show up right away and be replaced 1 minute later. I don't want to see both though, so I archive.
  • the script finds all messages with the ToBeStripped, and if it wasn't moved to the trash in a previous run, it pulls out the interesting bits of the message. Most of the formatting will be removed.
  • when complete, it will email it to whatever email address you specified, which generally would be the same email address that received the original if you use gmail. Note that the new reformatted email now comes from you, not from noreply@geocaching.com.
  • the original message is moved to the trash so it doesn't get processed again. If for some reason you want it, the messages in trash will be available for 30 days.
  • this basically gives you an option to turn on notifications as text or html. If you want the originals back again, you can either turn off the script, or turn off the email filtering rule set up in the first step.
  • since this is doing the equivalent of web page scraping on your email messages, it is subject to breakage if HQ changes email format. But I wrote this 2 years ago and it still works (just made a few minor changes to process).
     

 

Results:

 

Before:

aOI9c4j.png

 

After:

M6cREul.png

Share this post


Link to post

Nice work. Though a [X] Plaintext Email option on the Profile/Preferences page would be even better, and not require any such glue logic within the email tools. This was brought up umpteen times when the email format changed to the annoying new HTML default in July 2014. Groundspeak though continues to send Facebook and Twitter icons, plus lots of other HTML crud that nobody wants, particularly not on mobile devices.

 

I also use glue logic - my "frogturd" procmail script removes most of the mess. But GC.com is the only service where I have to pre-process emails to make them less annoying. And it is even a service that I pay membership fees for, whereas plenty of other services that I use give me the choice between HTML and ASCII email for free. Go figure.

Share this post


Link to post

Though a [X] Plaintext Email option on the Profile/Preferences page would be even better

 

That's what I would like, but I don't have input. :)

 

Most corporate emails such as newsletters, weekly sales, receipts, etc ... are heavily marked up and branded. That makes sense in most cases.

 

Notifications of replies and new topic on most online forums are text, or mostly text. Cnn.com breaking news is also text, at least that's what I get - I can't remember if I set up preferences for it. Personally I consider a log notification on one of my caches to be in this category - it's a notification of change, and for full context I can click the link. I'd rather not have all the formatting and branding in this sort of email. In the weekly geocaching.com email and newsletters and such, that makes perfect sense to have a nicely formatted note with graphics, color, branding, etc ...

 

This was brought up umpteen times when the email format changed to the annoying new HTML default in July 2014.

 

That's whey I first wrote this little google apps script. I know there are (were) a few people using it when I made it available. It's not a perfect solution as it does require a gmail account, though by having notifications sent to gmail you can forward them onto your real email if you aren't a gmail user. But that's more of a pain, which is why I didn't detail the logic for that.

Share this post


Link to post

That was a very helpful post for those that do indeed have gmail, Chilihead, and I understand that it is the best that you can offer, so thanks. However... I do not use gmail for my notifications (nor do I wish to) and the simple solution would have been to simply not change the notifications in the first place. Have they said anywhere what the possible motivation was for it?

Share this post


Link to post

Have they said anywhere what the possible motivation was for it?

 

I haven't seen any comments from HQ on the change.

 

I've been writing (software engineer) user interfaces for 28 years, working extensively with user experience (UX) engineers the entire time ... I even married one.

 

Many times I'll see what our UX team is asking, and I think it's stupid. It doesn't meet my needs, I think it's less efficient or looks stupid. Or more selfishly, it's hard to implement and maintain. It's non standard.

 

But you know what? Most of the time the UX team is right. They spend countless hours running usability studies with many types of users. They figure out what is the best option for the most people. The devices my company makes have users that are occasional walk up users, to dedicated 40 hour a week users. Some of our devices cost well over $1 million USD, so we take usability seriously. But we are a $19 billion company, and usually have the funds to spend on studies.

 

The UX team has a difficult job figuring out what works for a variety of user types. Nothing is going to be perfect. If you make a system real easy for a casual user, the power users complain because the work flow suffers. If you optimize for the work flow, then a casual walk up user is going to be confused.

 

I'm assuming in this case that the UX team has run tests, have gotten input from focus groups. I don't like the result, but I'm probably in the 1%. As are most people in the forums here - the 1% that have been geocaching for a while, understand the ins and outs, get a ton of geocaching.com email, and are basically power users. For the rest of the 99%, they have few caches and get few logs. For those logs they get, the UX team and senior management have decided (my speculation) that this change is a positive one.

 

All that said, I'd still like an option for html/text for us power users. :)

Share this post


Link to post

I'm assuming in this case that the UX team has run tests, have gotten input from focus groups.

You're kidding, right? It seems clear to me that extent of the "research" was someone in charge said, "We need to 'brand' the e-mail we send," and the UX guy ("Team"? Kidding again?) said, "Yessir." Less clear to me is whether this last change was someone in charge saying "Time to rebrand" or the UX guy getting bored and tweaking it in his spare time.

Share this post


Link to post

I'm assuming in this case that the UX team has run tests, have gotten input from focus groups.

You're kidding, right? It seems clear to me that extent of the "research" was someone in charge said, "We need to 'brand' the e-mail we send," and the UX guy ("Team"? Kidding again?) said, "Yessir." Less clear to me is whether this last change was someone in charge saying "Time to rebrand" or the UX guy getting bored and tweaking it in his spare time.

 

I honestly don't think that Chilihead's respectful and thought-out post deserves that sort of sarcasm, but I will say that my impression of the change, particularly the change in what I thought was practically a trademark hue of forest green does indeed have every appearance of your "bored and tweaking" scenario!

Share this post


Link to post

Hi Chilehead,

I tried your script but it doesn't work.

I did exactly like you wrote.

No idea why.

-lumbricus

Share this post


Link to post

Thanks for the script ChileHead, worked for me

 

lumbricus, did you put your email address in the script?

Edited by allrounder

Share this post


Link to post

Hi Chilehead,

I tried your script but it doesn't work.

I did exactly like you wrote.

No idea why.

-lumbricus

 

Are you only seeing the original and it doesn't have the ToBeStripped tag on it? If so, then likely the gmail filter didn't find the messages and apply the tag. If gmail doesn't apply the tag, then the script won't run.

 

Are you only seeing the original and it has the ToBeStripped tag but nothing else happened? (check "all" mail, not just "inbox" in case the filter ran and archived the note.) Then the script probably didn't run. Make sure you applied the "run every minute" rule after you had saved the script.

 

Are you not seeing the original at all? If not, check your trash. If it's in the trash then the script ran but probably didn't forward it on. Check the end of the script to make sure you put in your email.

 

If you have to check the script, go to http://www.google.com/script, click on "File -> Open" and find your script. Odd thing is that sometimes if I click the script it doesn't know what to do, but if I right click the script and say "open with google apps script" it works.

Share this post


Link to post

I'm assuming in this case that the UX team has run tests, have gotten input from focus groups.

You're kidding, right? It seems clear to me that extent of the "research" was someone in charge said, "We need to 'brand' the e-mail we send," and the UX guy ("Team"? Kidding again?) said, "Yessir." Less clear to me is whether this last change was someone in charge saying "Time to rebrand" or the UX guy getting bored and tweaking it in his spare time.

 

Obviously you don't work in the industry. I do. I've been writing user interfaces for nearly 30 years, and I know how the process works at most companies. I don't know the details at geocaching.com, but I do know they have a UX team who is responsible for things like this. By no means am I defending the result, as it's clear I don't like it. But they are the ones that have the results of usability studies and where the industry is going.

Share this post


Link to post

Is there a maximum you can run this script per day?

 

"You" don't run it, it runs automatically. If you have it set up like mine, then it runs every minute, so the max is 86400 times per day.

Share this post


Link to post

Obviously you don't work in the industry. I do. I've been writing user interfaces for nearly 30 years, and I know how the process works at most companies. I don't know the details at geocaching.com, but I do know they have a UX team who is responsible for things like this. By no means am I defending the result, as it's clear I don't like it. But they are the ones that have the results of usability studies and where the industry is going.

I've worked in the industry as long as you, and I've seen lots of very large companies thinking they have a better idea of what the customers need, want, and will like than the customers themselves do. And this is a good time to think that's the case here: I think GS is mainly thinking about the customers of the future that they can't poll, anyway. I can't fault them for that, as much as I don't care for the results.

 

Even if I were wrong about that, I doubt GS is so large that they can field an entire team dedicated to deciding something as trivial as what e-mail looks like, let alone have excess resources to do extensive market research on it. (Besides, can you really imagine them doing extensive market research without any of us hearing about it?)

Share this post


Link to post

Even if I were wrong about that, I doubt GS is so large that they can field an entire team dedicated to deciding something as trivial as what e-mail looks like, let alone have excess resources to do extensive market research on it. (Besides, can you really imagine them doing extensive market research without any of us hearing about it?)

 

Simple, before you can share your ideas with them you have to sign a nondisclosure agreement that even prevents you from mentioning you participated in the market research.

Share this post


Link to post

BTW this works with new cache notifications as well if you set up an additional filter to apply the label.

 

But I wouldn't recommend if you are a FTF hound as it delays you by 1 precious minute.

Edited by ChileHead

Share this post


Link to post
...Are you only seeing the original and it has the ToBeStripped tag but nothing else happened? (check "all" mail, not just "inbox" in case the filter ran and archived the note.) Then the script probably didn't run. Make sure you applied the "run every minute" rule after you had saved the script...

Yes, all messages/mails have the ToBeStripped tag but the script doesn't work. I run it, but nothing happens. Every minute is set also. :sad:

Share this post


Link to post
...Are you only seeing the original and it has the ToBeStripped tag but nothing else happened? (check "all" mail, not just "inbox" in case the filter ran and archived the note.) Then the script probably didn't run. Make sure you applied the "run every minute" rule after you had saved the script...

Yes, all messages/mails have the ToBeStripped tag but the script doesn't work. I run it, but nothing happens. Every minute is set also. :sad:

 

OK, the email filter is working fine setting the tag.

 

If you go back into the script edit mode, select "View -> Execution transcript" ... does it show anything? It should show you when it ran, and any errors (maybe) that may have occurred.

Share this post


Link to post
...Are you only seeing the original and it has the ToBeStripped tag but nothing else happened? (check "all" mail, not just "inbox" in case the filter ran and archived the note.) Then the script probably didn't run. Make sure you applied the "run every minute" rule after you had saved the script...

Yes, all messages/mails have the ToBeStripped tag but the script doesn't work. I run it, but nothing happens. Every minute is set also. :sad:

 

OK, the email filter is working fine setting the tag.

 

If you go back into the script edit mode, select "View -> Execution transcript" ... does it show anything? It should show you when it ran, and any errors (maybe) that may have occurred.

 

Doh! I think I know why you can't run it. You are German, correct? Then I assume your email notifications come translated. So if you look at the script, I'm looking for English strings, and it would not likely match. Let me see if I can make this more generic, though I'm not sure I can. Alternatively you can change the English strings in the script to be the German ones you get. There may be some other multinat preference that messes with the script as well.

 

Edit: Nevermind ... I changed my preferences to German and the notes still come as English. I would have thought that would be translated.

Edited by ChileHead

Share this post


Link to post

Simple, before you can share your ideas with them you have to sign a nondisclosure agreement that even prevents you from mentioning you participated in the market research.

I can't imagine why they'd bother to shut people up, since if they're doing such research, it's all to their advantage to let people talk about how much research they're doing. But even if they were, I would expect to hear about the nondisclosure agreements whether people could talk about the actual questions asked or not.

Share this post


Link to post

Simple, before you can share your ideas with them you have to sign a nondisclosure agreement that even prevents you from mentioning you participated in the market research.

I can't imagine why they'd bother to shut people up, since if they're doing such research, it's all to their advantage to let people talk about how much research they're doing. But even if they were, I would expect to hear about the nondisclosure agreements whether people could talk about the actual questions asked or not.

They do. Last year before the block party you could sign up for a session to explore changes to geocaching. This was covered by a NDA, the participants could not discuss what was said and really could not discuss that they were chosen. GS is a privately held company that likes to keep things close to their chest.

Share this post


Link to post

Useful, maybe. I have more than 100 directories where are mails from GS sorted in (for every cache, for events, for notifications etc..) I am not sure if I should try this hack. I'd appreciate a system solution - simple text with links.

 

P.S. I really, really very well know that these mails are from Groundspeak and they relate the Geocaching game. No doubt.

Share this post


Link to post

I tried to use the script to strip the HTML from my old revived logs found a problem. The GmailApp.sendEmail function is limited to 100 emails per day so the script soon stopped working.

 

The limit "Email recipients per day" looks like it is for number of mails and not number of different recipients. It looks like the limit also applies to your own account and it appear not to exist any api metods to add/edit messages on your own account.

I like to receive all logs from all caches near me and that script wont work because there will be more then 100 mail most days.

 

But I have not seen the possibilities with Google script and gmail. It will be a great replacement for my current gmail filters to set appropriate labels for geocaching mails

 

You should probably remove your email adress from the updates script like is was in the original

Share this post


Link to post

The GmailApp.sendEmail function is limited to 100 emails per day so the script soon stopped working.

 

I didn't know that. I guess I haven't received that many emails yet in a day. Wonder if there is an alternative to edit in place (I couldn't find one before.)

 

You should probably remove your email adress from the updates script like is was in the original

 

Thanks for pointing that out, I must have missed it. I couldn't edit the original post, so I deleted it. Here's the updated script for anybody interested (if the 100 per day limit isn't an issue):

 

function process() {
 var labelName="ToBeStripped";

 var label = GmailApp.getUserLabelByName(labelName);
 var threads = label.getThreads();

 for (var i=0; i<threads.length; i++)
 {
   var msgs = threads[i].getMessages();
   for (var m=0; m<msgs.length; m++)
   {
     var msg = msgs[m];

     if (! msg.isInTrash())
     {
       var body = msg.getBody();
       var subject = msg.getSubject();
       var textBody = "";        

       var lines = body.split("\n");
       for (var l=0; l<lines.length; l++)
       {
         var line = lines[l];
         if (line.indexOf("Logged by") != -1 ||
             line.indexOf("has a new log") != -1 ||
             line.indexOf("Log Type") != -1 ||
             line.indexOf("Date:") != -1 ||
             line.indexOf("Location:") != -1 ||
             line.indexOf("Name:") != -1 ||
             line.indexOf("Distance:") != -1 ||
             line.indexOf("Created by:") != -1 ||
             line.indexOf("Type:") != -1)
                textBody = textBody + line;
         else if (line.indexOf("Log</a>:</strong>") != -1)
           textBody = textBody + lines[l+1];
         else if (line.indexOf("Remove this from my watchlist") != -1)
           textBody = textBody + "<br>" + line;
       }

       // textBody and htmlBody are the same for now, but both stripped down versions of the original
       GmailApp.sendEmail('YOUR_EMAIL_HERE', subject, textBody, { htmlBody: textBody });   
       GmailApp.moveMessageToTrash(msg);
     }
   }
 }
};

Share this post


Link to post

Thanks ChileHead. I Took your script and adjusted it a bit to write the logs to a google spreadsheet.

You have to have your notifications labeled as "GEONOTIFY" and you also have to have a label called "GeonotifyDone" (or if you want something else, just change it in the code below)

 

There is a lot of quick and dirty coding, and even a small change in the notifications will break one of the filters..but it works for now. And since emails aren't deleted but just labeled differently you can always relabel them back manually so they will get picked up again.

 

function process() {
 var labelName="GEONOTIFY";
 var labelNameDone="GeonotifyDone"

 var spreadsheet = openSheetByName("GeoNotificaties");
 var sheet = spreadsheet.getActiveSheet();
 var nextRow = sheet.getLastRow()+1;

 var label = GmailApp.getUserLabelByName(labelName);
 var labeldone = GmailApp.getUserLabelByName(labelNameDone);
 var threads = label.getThreads();

 var regExpLoggedByUser = new RegExp("(target=\"_blank\">)(.*)(</a><br>)", "i"); // "i" is for case insensitive
 var regExpLoggedByUserLink = new RegExp("(http://coord.info/PR[a-z0-9]+)","i");
 var regExpLogType = new RegExp("(</strong> )(.*?)(<br>)","i");
 var regExpLocation = regExpLogType;
 var regExpDate = regExpLogType;
 var regExpCacheType = regExpLogType;
 var regExpDistance = regExpLogType;
 var regExpPublishedby = regExpLogType;
 var regExpCreatedby = regExpLogType;
 var regExpLogLink = new RegExp("(http://coord.info/GL[a-z0-9]+)","i");
 var regExpCache = new RegExp("(http://coord.info/GC[a-z0-9]+)(\" target=\"_blank\">)(.*)( \\()(GC[a-z0-9]+)(\\))(.*?)(http://www.geocaching.com/notify/edit.aspx\\?NID=[a-z0-9]+)(.*?target=\"_blank\">)(.*)(</a>, has a new log:)","i");
 var regExpNewCache = new RegExp("(http://coord.info/GC[a-z0-9]+)(\" target=\"_blank\">)(.*)( \\()(GC[a-z0-9]+)(\\).*)","i")
 var regExpNot = new RegExp("(http://www.geocaching.com/notify/edit.aspx\\?NID=[a-z0-9]+)(.*?target=\"_blank\">)(.*?)(</a>)","i");

 var timestamp = 0;
 var gclink = 1;
 var gccode = 2;
 var cachename = 3;
 var cachetype = 4;
 var location = 5;
 var user = 6;
 var userlink = 7;
 var logtype = 8;
 var logdate = 9;
 var log = 10;
 var loglink = 11;  
 var createdby = 12;
 var distance = 13;
 var notlistname = 14;
 var notlistlink = 15;

 var maxcol = 16;

 for (var i=0; i<threads.length; i++)
 {
   var msgs = threads[i].getMessages();
   for (var m=0; m<msgs.length; m++)
   {
     var msg = msgs[m];

     if (! msg.isInTrash())
     {
       var body = msg.getBody();
       var subject = msg.getSubject();

       var textBody = "";       

       var lines = body.split("\n");

       var values = [];
       for (var j=0;j<maxcol;j++) {
         values[j] = " ";
       }

       values[0] = new Date();

       for (var l=0; l<lines.length; l++)
       {
         var line = lines[l];
         if (line.indexOf("Logged by") != -1) {

           values[user] = regExpLoggedByUser.exec(line)[2];
           values[userlink] = regExpLoggedByUserLink.exec(line)[0];
         }
         if (line.indexOf("Log Type") != -1) {
           values[logtype] = regExpLogType.exec(line)[2];
         }
         if (line.indexOf("Location:") != -1) {
           values[location] = regExpLocation.exec(line)[2];
         }
         if (line.indexOf("Date:") != -1) {
           values[logdate] = getDateFromNotification(regExpDate.exec(line)[2]);
         }
         if (line.indexOf("Type:") != -1) {
           values[cachetype] = regExpCacheType.exec(line)[2];
         }
         if (line.indexOf("Log</a>:</strong>") != -1) {
           values[loglink] = regExpLogLink.exec(line)[0];
           values[log] = lines[l+1]
         }
         if (line.indexOf("has a new log") != -1) {
           var d = line.match(regExpCache);
           values[gclink] = d[1];
           values[cachename] = d[3];
           values[gccode] = d[5];
           values[notlistlink] = d[8];
           values[notlistname] = d[10];
         }
         if (line.indexOf("Distance:") != -1) {
           values[distance] = regExpDistance.exec(line)[2];
         }
         if (line.indexOf("Published by:") != -1) {
           values[user] = regExpPublishedby.exec(line)[2];
           values[logtype] = "Publish listing";
         }
         if (line.indexOf("Created by:") != -1) {
           values[createdby] = regExpCreatedby.exec(line)[2];
         }
         if (line.indexOf("Name:") != -1) {
           var d = line.match(regExpNewCache);
           values[gclink] = d[1];
           values[cachename] = d[3];
           values[gccode] = d[5];
         }
         if (line.indexOf("Edit the settings") != -1) {
           var d = line.match(regExpNot);
           values[notlistlink] = d[1];
           values[notlistname] = d[3];
         }


       }
       values2D = [values];
       sheet.getRange(nextRow,1,1,maxcol).setValues(values2D);
       nextRow = nextRow + 1;


     }
   }
   labeldone.addToThread(threads[i]);
  label.removeFromThread(threads[i]);
 }
};




/**
* Returns the Spreadsheet with the given file name. If no such spreadsheet
* exists, it will be created.
*/
function openSheetByName(filename) {
 if (arguments.length == 0 || filename =="") throw new Error( "Missing filename." );

 var files = DriveApp.getFiles();
 var sheet;
 // Loop over all spreadsheet files. Loop ends when we reach the end,
 // or if we find a matching filename.
 while (files.hasNext()) {
   var file = files.next()
   Logger.log(file.getName());
   if (file.getName() == filename) {
     return SpreadsheetApp.openById(file.getId())
   }
 }

   // We didn't find the file, so create it.
 return SpreadsheetApp.create(filename);

}



function getDateFromNotification(string) {
 try{
   var regexp = "([0-9]+)(/)([0-9]+)(/)([0-9]{4})";
   var d = string.match(new RegExp(regexp));
   var date = new Date(d[5], d[1]-1, d[3]);
   return date;
 } 
 catch(e){
   return;
 }
}

Share this post


Link to post

Thanks ChileHead. I Took your script and adjusted it a bit to write the logs to a google spreadsheet.

You have to have your notifications labeled as "GEONOTIFY" and you also have to have a label called "GeonotifyDone" (or if you want something else, just change it in the code below)

 

There is a lot of quick and dirty coding, and even a small change in the notifications will break one of the filters..but it works for now. And since emails aren't deleted but just labeled differently you can always relabel them back manually so they will get picked up again.

 

Cool ... I had thought about doing something similar to that, mostly for play. I don't care enough to keep the notifications long term, I only want to read them, then delete (without all the extra scrolling and white space.)

 

I have a change to my original script that will "fix" the problem if you get more than 100 emails in a day. It's not really a fix though - it just moves the original back into the inbox once you exceed the limit, so you don't lose anything. I'll post that later.

 

I'd rather have a switch on geocaching.com for my notifications though. :(

Share this post


Link to post

Thanks ChileHead. I Took your script and adjusted it a bit to write the logs to a google spreadsheet.

You have to have your notifications labeled as "GEONOTIFY" and you also have to have a label called "GeonotifyDone" (or if you want something else, just change it in the code below)

 

There is a lot of quick and dirty coding, and even a small change in the notifications will break one of the filters..but it works for now. And since emails aren't deleted but just labeled differently you can always relabel them back manually so they will get picked up again.

 

Cool ... I had thought about doing something similar to that, mostly for play.

 

I don't see the added benefit either, but before reading this thread I didn't know google offered this and wanted to try it to see what I could do with it. Just some fun trying to figure things out :)

I think I already run into a bug because of the grouping of gmail.

Message 1 is processed and gets label "geonotifydone". If a new mail, from the same person for the same cache (so the topic is identical) is send later , gmail will give it the new label and groups it with the first message. So now the entire thread has both labels and both messages will appear in my sheet. (so message 1 is displayed twice)

Edited by PnavE_81

Share this post


Link to post

I'm using the script by ChileHead. Since a week or so, a log has only 1 or 2 lines after being processed by the google script. I assume that HQ has changed something in the layout of the mail. What can I do about this?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  
Followers 4

×
×
  • Create New...