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

  <strings>
    <string name="homePageURL" locale="default">
      <![CDATA[http://www.xanga.com/]]>
    </string>

    <string name="loginURL" locale="default">
      <![CDATA[http://www.xanga.com/signin.aspx]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host=".xanga.com" name="GUID" path="/"/>
    <cookie host=".xanga.com" name="u" path="/"/>
    <cookie host=".xanga.com" name="x" path="/"/>
  </sessioncookies>

  <detect type="login">
    <url domain="xanga.com"/>
    <form>
      <field fieldid="XangaHeader_txtSigninUsername" extractas="username"/>
      <field fieldid="XangaHeader_txtSigninPassword" type="password" extractas="password"/>
    </form>
  </detect>

  <detect type="login">
    <url domain="xanga.com"/>
    <form>
      <field fieldid="txtSigninUsername" extractas="username"/>
      <field fieldid="txtSigninPassword" type="password" extractas="password"/>
    </form>
  </detect>

  <detect type="signup">
    <url domain="xanga.com"><path contains="register"/></url>
    <form>
      <field name="txtUsername" extractas="username"/>
      <field name="txtPassword2" type="password" extractas="password"/>
    </form>
  </detect>

  <detect type="signup">
    <url domain="xanga.com"><path contains="register"/></url>
    <form>
      <field name="registrationModule$txtUsername" extractas="username"/>
      <field name="registrationModule$txtPassword2" type="password" extractas="password"/>
    </form>
  </detect>
  
  <detect type="signup">
    <url domain="xanga.com"><path contains="signin"/></url>
    <form>
      <field name="txtUsername" extractas="username"/>
      <field name="txtPassword2" type="password" extractas="password"/>
    </form>
  </detect>

  <detect type="loggedin"><!-- New as of 2008-02-19 -->
    <xpath>
      <![CDATA[//ul[@id="x-user"]//a[contains(@href,"xanga.com/logout.aspx")]]]>
    </xpath>
  </detect>

  <detect type="loggedin"><!-- Probably obsolete as of 2008-02-19 -->
    <conditions>
      <url domain="xanga.com"/>
      <document>
        <xpath><![CDATA[//center/span/table/tbody/tr/td/div/a/text()[contains(.,"sign out")]]]></xpath>
      </document>
    </conditions>
  </detect>

  <detect type="loggedin"><!-- Probably obsolete as of 2008-02-19 -->
    <conditions>
      <url domain="xanga.com"/>
      <document>
        <xpath><![CDATA[//div[@id="xtoolbar"]//ul[@id="xuser"]//a/text()[contains(.,"sign out")]]]></xpath>
      </document>
    </conditions>
  </detect>
  
  <detect type="loggedout"><!-- New as of 2008-02-19 -->
    <xpath>
      <![CDATA[//ul[@id="x-user"]//a[contains(@href,"xanga.com/signin.aspx")]]]>
    </xpath>
  </detect>

  <detect type="loggedout"><!-- Probably obsolete as of 2008-02-19 -->
    <conditions>
      <url domain="xanga.com"/>
      <document>
        <xpath><![CDATA[//div[@id="xpagewrap"]/div[@id="xmain"]/div[@id="xmaincontent"]/ul/li/a/text()[contains(.,"sign in")]]]></xpath>
      </document>
    </conditions>
  </detect>

  <detect type="accountinfo"><!-- New as of 2008-02-19 -->
    <xpath>
      <![CDATA[//ul[@id="x-user"]//strong[@id="x-usernav-current"]/text()]]>
      <regexp re1="accountid" multiline="true"><![CDATA[/(\S+)/]]></regexp>
    </xpath>
  </detect>

  <detect type="accountinfo">
    <xpath name="accountid">
      <![CDATA[//div[@id="xusernav"]//a[@id="xunav"]//strong/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"><!-- Probably obsolete as of 2008-02-19 -->
    <results>
      <regexp re1="accountid">
        <![CDATA[/"http:\/\/www\.xanga\.com\/private\/home\.aspx\?user=([^"]+)"/]]>
      </regexp>
    </results>
  </detect>

  <detect type="avatarURLDetect">
    <xpath name="avatarURL" extract="attribute:src">
      <![CDATA[//img[@id='xpProfileImage']]]>
    </xpath>
  </detect>
  
  <detect type="changepassword">
    <url domain="xanga.com"><path contains="editemailpassword"/></url>
    <document>
      <regexp multiline="true" re1="username">
        <![CDATA[/Username:.*?<td[^>]*?>(.*?)<\/td>/]]>
      </regexp>
    </document>
    <form>
      <xpath name="password" extract="value">
        <![CDATA[//input[@type="password"][@name="pwdNewPassword2"]]]>
      </xpath>
   </form>
  </detect>

</service>
