Comcast email dataURL no longer good

It appears that the dataURL for Comcast webmail (http://xfinityconnect.mail.comcast.net/) is no longer good so the script cannot find read/unread information when it checks.

I can't seem to find another page with similar info.  Can anyone else?

Dan

Offsprung's picture

Was going to request new comcast also. Sort or search on the script page might be REQUIRED?

Tr3b's picture

Admin...Test Account has been enabed for you.  I have sent you an e-mail  with info.

dankirkd's picture

Was that to me or to Offsprung?

Tr3b's post is to the X-Notifier author/admin, Tobwithu.

Tr3b's picture

Comcast accounts now working with new script

dankirkd's picture

Thanks.  This appears to work, although the dataURL and viewURL locations redirect to http://web.mail.comcast.net/zimbra/mail?app=mail#1 so it seems that they should be updated too.

My additional use case is to only count unread emails from a given sender.  I've added extra logic to do this, but it isn't obvious what JSON is being used to identify the unread emails at an email level.  This is what I use:

function getCount(aData){
  var fnd=aData.match(/"name":"Inbox".+?(?:"u":(\d+))?,"view"/);
  var unreadCount = fnd?(fnd[1]?fnd[1]:0):-1;
  // Can't read page would yield -1:
  if (unreadCount == -1)
    return -1;
  else {
    var pattern = /"f":"(.+)".*?"a":"(.+)"/g;
    var match;
    var count = 0;
    // The while loop will yield all match pairs:
    while (match = pattern.exec(aData)) {
        // If the array pos 1 match is 'u' we count that:
        if (match[1] == "u" && match[2] == "sender@email.address")
            count++;
    }
    return count;
  }
}

As you can see I'm looking for "f":"u" followed by the specific sender email.  But my logging is inconclusive that this is in fact how they are identified.

Dan

dankirkd's picture

Actually, that logic for the match should be:

if (match[1].indexOf("u") > -1 && match[2] == "sender@email.address") ...

because sometimes "u" isn't the only letter used in the JSON (I've also seen "f":"au" on unread emails).

I'm still testing this.

dankirkd's picture

The new script works.  My embellishment to count just unread emails from a given sender are as follows:

  this.dataURL="http://web.mail.comcast.net/zimbra/mail?app=mail#1";
  this.viewURL="http://web.mail.comcast.net/zimbra/mail?app=mail#1";

function getCount(aData){
  var fnd=aData.match(/"name":"Inbox".+?(?:"u":(\d+))?,"view"/);
  var unreadCount = fnd?(fnd[1]?fnd[1]:0):-1;
  // Can't read page would yield -1:
  if (unreadCount == -1)
    return -1;
  else {
    var pattern = /"f":"(.+?)".*?"a":"(.+?)"/g;
    var match;
    var count = 0;
    // The while loop will yield all match pairs:
    while (match = pattern.exec(aData)) {
        // If the array pos 1 match contains 'u' we count that:
        if (match[1].indexOf("u") > -1 && match[2] == "sender@email.address")
            count++;
    }
    return count;
  }
}

Thanks.