<?xml version="1.0" encoding="utf-8"?>
<service name="aolmail"
         version="$Id: aolmail.xml 19845 2008-08-08 21:12:47Z manish $"
         xmlns="http://www.flock.com/web-detective#">

  <strings>
    <string name="basic" value="/Lite/" />
    <string name="datetime_re">
      <![CDATA[^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.)(\d{2}):(\d{2})$]]>
    </string>
    <string name="domains" value="aol.com,aim.com,aol.ca,aol.de,aol.fr,aol.nl,aol.es,aol.se,aol.be,aol.ch,aol.it,aol.pl,aol.co.uk,aol.in,aol.com.mx" />
    <string name="refreshUnreadMessageListDelay" value="10000" />
    <string name="uid_re">
      <![CDATA[&uid=([^&]+)]]>
    </string>

    <string name="homePageURL" locale="default">
      <![CDATA[http://webmail.aol.com/]]>
    </string>

    <string name="homePageURL" locale="de">
      <![CDATA[https://my.screenname.aol.com/_cqr/login/login.psp?sitedomain=sns.webmail.aol.com&lang=de&locale=de&authLev=0&siteState=ver%3a3%7cac%3aWS%7cat%3aSNS%7cld%3awebmail.aol.de%7cuv%3aAFFINITY%7clc%3ade-de%7cmt%3aAIM%7csnt%3aAffinityDomains&offerId=webmail-de-de&seamless=novl]]>
    </string>

    <!-- Basic version URLs -->

    <string name="basicComposeURL">
      <![CDATA[http://webmail.aol.com/Lite/Compose.aspx?%params%]]>
    </string>
    <string name="basicInboxURL">
      <![CDATA[http://webmail.aol.com/Lite/MsgList.aspx?folder=Inbox]]>
    </string>
    <string name="basicMessageURL">
      <![CDATA[http://webmail.aol.com/Lite/MsgRead.aspx?folder=Inbox&uid=1.%id%]]>
    </string>

    <!-- Standard version URLS -->

    <string name="standardComposeURL">
      <![CDATA[http://webmail.aol.com/Mail/ComposeMessage.aspx?%params%]]>
    </string>
    <string name="standardInboxURL">
      <![CDATA[http://webmail.aol.com/Suite.aspx?app=mail&folder=Inbox]]>
    </string>
    <string name="standardMessageURL">
      <![CDATA[http://webmail.aol.com/Mail/DisplayMessage.aspx?folder=Inbox&uid=%id%]]>
    </string>

    <!-- API strings -->

    <string name="authURL">
      <![CDATA[https://api.screenname.aol.com/auth/%method%]]>
    </string>
    <string name="authBody">
      <![CDATA[devId=fl1tA2C69oQUJFzs&f=json&s=%userId%&tokenType=longterm]]>
    </string>
    <string name="mailURL">
      <![CDATA[https://api.mail.aol.com/mail/%method%]]>
    </string>
    <string name="mailBody">
      <![CDATA[devId=fl1tA2C69oQUJFzs&f=json&a=%token%]]>
    </string>
    <string name="referer">
      <![CDATA[http://www.flock.com]]>
    </string>

    <!-- DnD strings -->

    <string name="dndXPathFields">
      <![CDATA[basicPlainComposerXPath,text/unicode;standardPlainComposerXPath,text/unicode]]>
    </string>
    <string name="basicPlainComposerXPath">
      <![CDATA[//textarea[@id="PlainBody"]]]>
    </string>
    <string name="standardPlainComposerXPath">
      <![CDATA[//div[@dojoattachpoint="textareaPane" and @style[not(contains(.,"display: none"))]]//textarea[@dojoattachpoint="textarea"]]]>
    </string>

    <!-- Email retrieval strings -->

    <string name="email">
      <![CDATA[<div class=fieldsetHidden><input type=hidden name='From' value='(.+)'\/><\/div>]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host=".aol.com" name="SNS_AA" path="/" />
    <cookie host=".aol.com" name="SNS_ACT" path="/" />
    <cookie host=".screenname.aol.com" name="SNS_L0" path="/" />
  </sessioncookies>

  <!-- Basic composer detection rules -->

  <detect type="basicComposer"> <!-- Plain -->
    <xpath name="node" extract="this">
      <![CDATA[//textarea[@id="PlainBody"]]]>
    </xpath>
  </detect>

  <detect type="basicComposer"> <!-- Rich -->
    <xpath name="node" extract="this">
      <![CDATA[//iframe[@id="RichBody"]]]>
    </xpath>
  </detect>

  <detect type="basicRichComposerBody">
    <xpath>
      <![CDATA[//html[@id="RichBody"]//body]]>
    </xpath>
  </detect>

  <!-- Standard composer detection rules -->

  <detect type="standardComposer"> <!-- Rich -->
    <xpath name="node" extract="this">
      <![CDATA[//div[@dojoattachpoint="iframePane" and @style[not(contains(.,"display: none"))]]//iframe[@dojoattachpoint="iframe"]]]>
    </xpath>
  </detect>

  <detect type="standardComposer"> <!-- Plain -->
    <xpath name="node" extract="this">
      <![CDATA[//div[@dojoattachpoint="textareaPane" and @style[not(contains(.,"display: none"))]]//textarea[@dojoattachpoint="textarea"]]]>
    </xpath>
  </detect>

  <detect type="standardRichComposerBody">
    <xpath>
      <![CDATA[//body//text()[string-length(.)>0]]]>
    </xpath>
  </detect>

  <!-- Sign up rules -->

  <detect type="signup">
    <url domain="new.aol.com">
      <path contains="freeaolweb" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="{actionForm.desiredSN}"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="{actionForm.verifyPassword}"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup">
    <url domain="intlreg.aol.com">
      <path contains="onswrpweb" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="{actionForm.loginId}"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@name="{actionForm.passwordretype}"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup">
    <url domain="reg.my.screenname.aol.com">
       <path contains="registration" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="loginIdlbl"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwordretypelbl"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup">
    <url>
      <host contains="join.aol." />
      <path contains="WebRegController" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@name="email_address"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@name="confirm_password"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup"> <!-- Personal/Affinity domains -->
    <url>
      <host contains="myeaddress.aol." />
      <path contains="personaldomain" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="userName"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="reTypePassword"]]]>
      </xpath>
    </form>
  </detect>

  <!-- Log in rules -->

  <detect type="login">
    <url domain="my.screenname.aol.com">
      <path contains="login.psp" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="lgnId1"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="pwdId1"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login">
    <url>
      <host contains="services.aol." />
      <path contains="webmail" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="lgnId1"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="pwdId1"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login">
    <url>
      <host contains="email.aol." />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="consoleSnsScreenName"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="consoleSnsPassword"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login">
    <url>
      <host contains="www.aol." />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="screenname"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="password"]]]>
      </xpath>
    </form>
  </detect>

  <!-- Logged in rules -->

  <detect type="loggedin"> <!-- Basic and Standard webmail chrome` -->
    <url domain="webmail.aol.com" />
    <xpath>
      <![CDATA[//div[@id="aoluid"]]]>
    </xpath>
  </detect>

  <detect type="loggedin"> <!-- Basic webmail chrome` -->
    <url domain="webmail.aol.com" />
    <xpath>
      <![CDATA[//div[@class="WSHat"]]]> <!-- Generic enough for all chrome -->
    </xpath>
  </detect>

  <detect type="loggedin"> <!-- Standard webmail chrome -->
    <url domain="webmail.aol.com" />
    <xpath>
      <![CDATA[//div[@id="HatWidget"]]]>
    </xpath>
  </detect>

  <detect type="loggedin"> <!-- Standard webmail stand-alone composer -->
    <url domain="webmail.aol.com" />
    <xpath>
      <![CDATA[//div[@id="layout"]]]>
    </xpath>
  </detect>

  <detect type="loggedin"> <!-- Standard webmail stand-alone message -->
    <url domain="webmail.aol.com" />
    <xpath>
      <![CDATA[//div[@id="displayLayout"]]]>
    </xpath>
  </detect>

  <!-- Logged out rules -->

  <detect type="loggedout">
    <url domain="my.screenname.aol.com">
      <path contains="login" />
    </url>
  </detect>

  <detect type="loggedout">
    <url domain="my.screenname.aol.com">
      <path contains="logout" />
    </url>
  </detect>

  <detect type="loggedout">
    <url>
      <path contains="webmail/logoff" />
    </url>
  </detect>

  <detect type="loggedout">
    <xpath>
      <![CDATA[//div[@id="sns"]/a[@name="om_signin"]]]>
    </xpath>
  </detect>

  <detect type="loggedout"> <!-- my.aol.com -->
    <xpath>
      <![CDATA[//div[@id="signin_div"]/div[@id="greeting"]/a[@class="signIn"]]]>
    </xpath>
  </detect>

  <detect type="loggedout"> <!-- *.aol.com -->
    <xpath>
      <![CDATA[//div[@id="snsContainer"]//a[contains(@href,"login")]]]>
    </xpath>
  </detect>

  <!-- Logged out cookie rules -->

  <detect type="loggedoutCookies">
    <cookie nomatch="true" host=".aol.com" name="SNS_ACT" />
    <cookie nomatch="true" host=".screenname.aol.com" name="SNS_L0" />
  </detect>

  <!-- Account info rules -->

  <detect type="accountinfo">  <!-- Basic and Standard webmail chrome` -->
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <![CDATA[//div[@id="aoluid"]/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"> <!-- Standard webmail main -->
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <!-- The welcome page greeting is less likely to be clipped for extra long
           account names than the screen name below -->
      <![CDATA[//div[@dojoattachpoint="greetingNode"]/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo">
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <!-- This is part of the sign out link on every page of the webmail -->
      <![CDATA[//span[@dojoattachpoint="screenNameNode"]/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"> <!-- Basic webmail main -->
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <!-- The welcome page greeting is less likely to be clipped for extra long
           account names than the salutation below -->
      <![CDATA[//div[@id="aolTodayGreeting"]/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo">
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <!-- This is part of the sign out link on every page of the webmail -->
      <![CDATA[//div[@class="salutation"]/nobr/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"> <!-- Standard webmail composer -->
    <url domain="webmail.aol.com" />
    <xpath name="accountid">
      <![CDATA[//div[@dojoattachpoint="headerWidget"]//tbody/tr[1]//span[@class="option"]/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"> <!-- Standard webmail message -->
    <url domain="webmail.aol.com" />
    <xpath name="accountid" extract="attribute:userinputform">
      <![CDATA[//div[@dojoattachpoint="fullToNode"]/span[@class="buddyIcon"]]]>
    </xpath>
  </detect>

</service>
