<?xml version="1.0" encoding="utf-8"?>
<service name="twitter"
         version="$Id: twitter.xml 22910 2009-10-20 07:06:31Z justin $"
         xmlns="http://www.flock.com/web-detective#">

  <strings>
    <string name="domains" value="twitter.com"/>
    <string name="mainpage">
      <![CDATA[http://twitter.com/]]>
    </string>

    <string name="searchPage">
      <![CDATA[http://search.twitter.com/search]]>
    </string>

    <string name="trendsURL">
      <![CDATA[http://search.twitter.com/trends/current.json]]>
    </string>

    <string name="userprofile">
      <![CDATA[http://twitter.com/%accountid%]]>
    </string>

    <string name="inviteFriendsURL">
      <![CDATA[http://twitter.com/invitations]]>
    </string>

    <string name="editprofile">
      <![CDATA[http://twitter.com/account/settings]]>
    </string>

    <string name="friendProfile">
      <![CDATA[http://twitter.com/%screenName%]]>
    </string>

    <string name="noAvatar">
      <![CDATA[twitter.com/images/default_profile]]>
    </string>

    <string name="statusURL">
      <![CDATA[http://twitter.com/%screenName%/status/%statusid%]]>
    </string>

    <string name="replyURL">
      <![CDATA[http://twitter.com/home?in_reply_to=%screenName%&in_reply_to_status_id=%statusid%&status=%40%screenName%+]]>
    </string>

    <string name="friendRetweet"
            value="method:twitter:retweet" />

    <string name="friendMessage"
            value="method:twitter:directMessage" />

    <string name="friendViewProfile">
      <![CDATA[newtab:http://twitter.com/account/redirect_by_id?id=%friendid%]]>
    </string>

    <string name="shareAction_directMessage">
      <![CDATA[newtab:http://twitter.com/direct_messages/create/%friendid%?text=%message%]]>
    </string>

    <string name="shareAction_publicMessage">
      <![CDATA[newtab:http://twitter.com/home?status=%message%]]>
    </string>

    <string name="dndXPathFields">
      <![CDATA[statusXPath,text/unicode;messageXPath,text/unicode]]>
    </string>
    <string name="statusXPath">
      <![CDATA[//textarea[@id="status"]]]>
    </string>
    <string name="messageXPath">
      <![CDATA[//textarea[@id="text"]]]>
    </string>

    <string name="homePageURL" locale="default">
      <![CDATA[https://twitter.com/]]>
    </string>

    <string name="loginURL" locale="default">
      <![CDATA[https://twitter.com/login]]>
    </string>

    <!-- Myworld Twitter widget -->
    <string name="avatarURL">
      <![CDATA[http://twitter.com/%username%]]>
    </string>

    <string name="tweetURL">
      <![CDATA[http://twitter.com/%username%/statuses/%tweetid%]]>
    </string>

    <string name="twitterSearchRefreshInterval" value="20" />

    <string name="linkifyStatusRegExp">
      <![CDATA[((https?:\/\/(\w+:{0,1}\w*@)?([\w_\-\.]+[A-Za-z0-9])|www\.[\w\-\.]+[A-Za-z0-9])(:[0-9]+)?(\/([^ ]*[^,. !:;])?)?)|(@\w+)|(#\w[\w\-]+)]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host=".twitter.com" path="/" name="_twitter_sess" />
    <cookie host="twitter.com" path="/" name="auth_token" />
  </sessioncookies>

  <!--
    - FlockSvcUtils::getCredentialsFromForm() and ::ownsLoginForm() look for
    - webdetective rules named "login", "signup", and "changepassword".
   -->
  <detect type="login">
    <url domain="twitter.com"/>
    <form>
      <field extractas="username"
             fieldid="email"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="pass"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <!-- Possibly obsolete as of 2008-07-22 -->
  <detect type="login">
    <url domain="twitter.com"/>
    <form>
      <field extractas="username"
             fieldid="username_or_email"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="password"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <detect type="login">
    <url domain="twitter.com"/>
    <form>
      <field extractas="username"
             fieldid="session[username_or_email]"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="session[password]"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <!-- http://twitter.com/login -->
  <detect type="login">
    <url domain="twitter.com" />
    <form>
      <field extractas="username"
             fieldid="username_or_email"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="session[password]"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <detect type="login">
    <url domain="twitter.com"/>
    <form>
      <field extractas="username"
             fieldid="username"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="password"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <detect type="signup">
    <url domain="twitter.com">
      <path contains="/signup" />
    </url>
    <form>
      <field extractas="username"
             fieldid="user_screen_name"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="user_user_password"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <detect type="signup">
    <url domain="twitter.com">
      <path contains="/account/create" />
    </url>
    <form>
      <field extractas="username"
             fieldid="user_screen_name"
             tagname="input"
             type="text" />
      <field extractas="password"
             fieldid="user_user_password"
             tagname="input"
             type="password" />
    </form>
  </detect>

  <detect type="loggedin">
    <xpath><![CDATA[//head/meta[@name="session-loggedin"][@content="y"]]]></xpath>
  </detect>

  <detect type="loggedout">
    <url><path equals="/login"/></url>
  </detect>

  <detect type="loggedout">
    <xpath><![CDATA[//form[@id="signin"]]]></xpath>
  </detect>

  <detect type="loggedoutcookies">
    <cookie nomatch="true" host=".twitter.com" name="_twitter_sess" />
    <cookie nomatch="true" host="twitter.com" name="auth_token" />
  </detect>

  <detect type="accountinfo">
    <xpath>
      <![CDATA[//head/meta[@name="session-userid"]/@content]]>
      <regexp re1="accountid"><![CDATA[/(\d+)/]]></regexp>
    </xpath>
  </detect>

</service>
