<?xml version="1.0" encoding="UTF-8"?>
<service name="myspace"
         version="$Id: myspace.xml 21204 2008-11-25 01:32:32Z manish $"
         xmlns="http://www.flock.com/web-detective#">

  <strings>
    <string name="domains" value="myspace.com" />
    <string name="inviteFriendsURL">
      <![CDATA[http://search.myspace.com/index.cfm?fuseaction=find]]>
    </string>
    <string name="noAvatar">
      <![CDATA[http://x.myspace(cdn)?.com/images/no_pic.gif]]>
    </string>
    <string name="timezoneOffset">
      <![CDATA[GMT-0700]]>
    </string>
    <string name="viewImageUrl">
      <![CDATA[http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&friendID=%friendid%&imageID=%imageid%]]>
    </string>
    <string name="meMessages_URL">
      <![CDATA[http://messaging.myspace.com/index.cfm?fuseaction=mail.inbox]]>
    </string>
    <string name="meFriendRequests_URL">
      <![CDATA[http://messaging.myspace.com/index.cfm?fuseaction=mail.friendRequests]]>
    </string>
    <string name="meEventInvitations_URL">
      <![CDATA[http://messaging.myspace.com/index.cfm?fuseaction=mail.eventInvite]]>
    </string>
    <string name="meComments_URL">
      <![CDATA[http://comment.myspace.com/index.cfm?fuseaction=user.viewComments&friendID=%id%]]>
    </string>
    <string name="profileURL">
      <![CDATA[http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=%friendid%]]>
    </string>
    <string name="friendViewProfile">
      <![CDATA[newtab:http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=%friendid%]]>
    </string>
    <string name="friendMessage">
      <![CDATA[newtab:http://messaging.myspace.com/index.cfm?fuseaction=mail.message&friendID=%friendid%]]>
    </string>
    <string name="friendAddToFaves">
      <![CDATA[newtab:http://collect.myspace.com/index.cfm?fuseaction=user.addToFavorite&friendID=%friendid%&public=0]]>
    </string>
    <string name="friendForward"
            value="method:flockIMyspaceAccount:forwardFriend" />
    <string name="friendForwardUrl">
      <![CDATA[http://messaging.myspace.com/index.cfm?fuseaction=mail.forward&friendID=%friendid%&f=forwardprofile]]>
    </string>
    <string name="friendComment">
      <![CDATA[newtab:http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=%friendid%]]>
    </string>
    <string name="friendShareFlock"
            value="method:flockIMyspaceAccount:shareFlock" />
    <string name="shareMessageWithFriend">
      <![CDATA[http://messaging.myspace.com/index.cfm?fuseaction=mail.message&friendID=%friendid%]]>
    </string>
    <string name="postLink">
      <![CDATA[http://comment.myspace.com/index.cfm?fuseaction=user.viewProfile_commentForm&friendID=%friendid%]]>
    </string>
    <string name="postLinkBodyId" value="ctl00_cpMain_UserWriteCommentsControl_commentTextBox" />

    <string name="dndXPathFields">
      <![CDATA[messageBodyXPath,text/html;composeBodyXPath,text/html;bulletinTextXPath,text/html;bulletinCommentXPath,text/html;commentXPath,text/html;photoCommentXPath,text/html;blogCommentXPath,text/html;blogContentXPath,text/html]]>
    </string>
    <string name="messageBodyXPath">
      <![CDATA[//textarea[contains(@id,"cpMain_messagingMain_SendMessage_bodyTextBox")]]]>
    </string>
    <string name="composeBodyXPath">
      <![CDATA[//textarea[contains(@id,"cpMain_messagingMain_ComposeMessage_bodyTextBox")]]]>
    </string>
    <string name="bulletinTextXPath">
      <![CDATA[//textarea[contains(@id, "cpMain_BulletinPost_Body_Textbox")]]]>
    </string>
    <string name="bulletinCommentXPath">
      <![CDATA[//textarea[contains(@id, "cpMain_BulletinComment_commentTextBox")]]]>
    </string>
    <string name="commentXPath">
      <![CDATA[//textarea[contains(@id, "cpMain_UserWriteCommentsControl_commentTextBox")]]]>
    </string>
    <string name="photoCommentXPath">
      <![CDATA[//textarea[contains(@id, "cpMain_tbxAddComment")]]]>
    </string>
    <string name="blogCommentXPath">
      <![CDATA[//div[@id="blogwrap"]//form[@id="theForm"]//textarea[@name="body"]]]>
    </string>
    <string name="blogContentXPath">
      <![CDATA[//div[@id="blog_content"]//form[@id="theForm"]//textarea[@name="body"]]]>
    </string>

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

    <!-- Comma delimited list of domain strings that are blocked by Myspace -->
    <string name="blockedDomainStrings">
      <![CDATA[revver.com/]]>
    </string>

    <string name="myspaceOAuthKey">
      <![CDATA[90B2C5D1569B4998A100E4BD104D7927]]>
    </string>
    <string name="myspaceOAuthSecretHash">
      <![CDATA[NRR66ORP594640n4NQ728OPR9R8OP75R]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host=".myspace.com" path="/" name="USER" />
  </sessioncookies>


  <!--
    - FlockSvcUtils::getCredentialsFromForm() and ::ownsLoginForm() look for
    - webdetective rules named "login", "signup", and "changepassword".
   -->
  <detect type="login">
    <url domain="myspace.com" />
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//form[@id="LoginForm"]//input[@id="ctl00_ctl00_Main_cpMain_LoginBox_Email_Textbox"][@type="text"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//form[@id="LoginForm"]//input[@id="ctl00_ctl00_Main_cpMain_LoginBox_Password_Textbox"][@type="password"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="signup">
    <url>
      <host equals="signups.myspace.com" />
      <querystring contains="fuseaction=signup" />
    </url>
    <form>
      <field tagname="input" fieldid="Email" extractas="username" />
      <field tagname="input" fieldid="Password" type="password" extractas="password" />
    </form>
  </detect>

  <!--
    - FlockSvcUtils::docRepresentsSuccessfulLogin() looks for a webdetective
    - rule named "loggedin".
   -->
  <detect type="loggedin">
    <xpath><![CDATA[//div[@id="header"]//a[contains(@href,"fuseaction=signout")]]]></xpath>
  </detect>

  <detect type="loggedin">
    <xpath><![CDATA[//div/table//a[contains(@href,"fuseaction=signout")]]]></xpath>
  </detect>

  <detect type="loggedout">
    <url>
      <host equals="login.myspace.com" />
      <querystring contains="fuseaction=login" />
    </url>
  </detect>

  <detect type="loggedout">
    <url>
      <querystring contains="fuseaction=signout" />
    </url>
    <regexp>
      <![CDATA[/fuseaction=join/]]>
    </regexp>
  </detect>

  <detect type="loggedout">
    <regexp>
      <![CDATA[/fuseaction=join/]]>
    </regexp>
  </detect>

  <!-- Possibly obsolete as of 2008-09-18 -->
  <detect type="loggedout">
    <url>
      <querystring contains="fuseaction=signout" />
    </url>
    <regexp>
      <![CDATA[/<script>ChangeLinkTextAndUrl\("aSignUpOrOut", "Sign Up"/]]>
    </regexp>
  </detect>

  <detect type="loggedoutcookie">
    <cookie nomatch="true" host=".myspace.com" name="ME" path="/" />
  </detect>


  <!--
    - FlockSvcUtils::getAccountIDFromDocument() looks for a webdetective rule
    - named "accountinfo".
   -->
  <detect type="accountinfo">
    <conditions>
      <url>
        <host equals="home.myspace.com" />
        <path contains="/index.cfm" />
        <querystring contains="fuseaction=user" />
      </url>
      <regexp re1="accountid">
        <![CDATA[/fuseaction=groups\.myGroups.+userid=(\d+)/]]>
      </regexp>
    </conditions>
    <results>
      <regexp re1="accountid">
        <![CDATA[/fuseaction=groups\.myGroups.+userid=(\d+)/]]>
      </regexp>
    </results>
  </detect>

  <detect type="accountinfo">
    <regexp re1="accountid">
      <![CDATA[/MySpace.ClientContext = {"UserId":(\d+),/]]>
    </regexp>
  </detect>

  <detect type="privatealbum">
    <regexp>
      <![CDATA[/The user you're trying to view has set all their photos to private./]]>
    </regexp>
  </detect>

  <!-- my home page -->
  <detect type="person">
    <url>
      <host equals="home.myspace.com" />
      <path contains="/index.cfm" />
      <querystring contains="fuseaction=user" />
    </url>
    <regexp re1="userid">
      <![CDATA[/fuseaction=groups\.myGroups.+userid=(\d+)/]]>
    </regexp>
    <regexp re1="username">
      <![CDATA[/var uName = "(.*)";/]]>
    </regexp>
  </detect>

  <!-- Pictures in an album page -->
  <detect type="person">
    <conditions>
      <url>
        <host equals="viewmorepics.myspace.com" />
        <path contains="/index.cfm" />
        <querystring contains="fuseaction=user.viewPicture" />
      </url>
    </conditions>
    <results>
      <url>
        <regexp re1="userid">
          <![CDATA[/friendID=([0-9]+)/]]>
        </regexp>
        <regexp re1="albumid">
          <![CDATA[/albumId=([0-9]+)/]]>
        </regexp>
      </url>
      <regexp re1="username" re2="albumname">
        <![CDATA[/<a id="ctl[0-9]+_cpMain_UserViewPictureControl_ImageListings1_dlImageList_ctl[0-9]+_hypImage" title="(.*) \- (.*) \- (.*)" class=/]]>
      </regexp>
    </results>
  </detect>

  <!-- User album page -->
  <detect type="person">
    <conditions>
      <url>
        <host equals="viewmorepics.myspace.com" />
        <path contains="/index.cfm" />
        <querystring contains="fuseaction=user.viewAlbums" />
      </url>
    </conditions>
    <results>
      <url>
        <regexp re1="userid">
          <![CDATA[/friendID=([0-9]+)/]]>
        </regexp>
      </url>
      <regexp re1="username">
        <![CDATA[/div class="feature_subheadLeft">(.+?)'s Albums</]]>
      </regexp>
    </results>
  </detect>

  <!-- Image page -->
  <detect type="image">
    <conditions>
      <url>
        <host equals="viewmorepics.myspace.com" />
        <path contains="/index.cfm" />
        <querystring contains="fuseaction=viewImage" />
      </url>
    </conditions>
    <results>
      <url>
        <regexp re1="userid">
          <![CDATA[/friendID=([0-9]+)/]]>
        </regexp>
        <regexp re1="imageid">
          <![CDATA[/imageID=([0-9]+)/]]>
        </regexp>
        <regexp re1="ajaxImageid">
          <![CDATA[/&i=([0-9]+)/]]>
        </regexp>
      </url>
    </results>
  </detect>

  <!-- media magic -->
  <detect type="image">
    <conditions>
      <regexp>
        <![CDATA[/^http:\/\/viewmorepics\.myspace\.com\/index\.cfm\?fuseaction=viewImage/]]>
      </regexp>
    </conditions>
    <results>
      <regexp re1="userid">
        <![CDATA[/friendID=([0-9]+)/]]>
      </regexp>
      <regexp re1="imageid">
        <![CDATA[/imageID=([0-9]+)/]]>
      </regexp>
    </results>
  </detect>

  <!-- Friend profile page -->
  <detect type="person">
    <conditions>
      <url>
        <host equals="profile.myspace.com" />
        <path contains="/index.cfm" />
        <querystring contains="fuseaction=user.viewprofile" />
      </url>
    </conditions>
    <results>
      <url>
        <regexp re1="userid">
          <![CDATA[/friendid=([0-9]+)/]]>
        </regexp>
      </url>
      <regexp re1="username">
        <![CDATA[/<span class="nametext">(.+?)</]]>
      </regexp>
    </results>
  </detect>

  <!-- http://www.myspace.com/<displayname> -->
  <detect type="person">
    <url domain="myspace.com" />
    <regexp re1="userid">
      <![CDATA[/var MySpaceClientContext = {"UserId":[0-9]+,"DisplayFriendId":([0-9]+),/]]>
    </regexp>
    <regexp re1="username">
      <![CDATA[/<span class="nametext">(.+?)</]]>
    </regexp>
  </detect>

  <detect type="isStreamUrl">
    <regexp>
      <![CDATA[/^http:\/\/viewmorepics\.myspace\.com\/index\.cfm\?fuseaction=viewImage/]]>
    </regexp>
  </detect>

  <detect type="messageSubject">
    <xpath name="node" extract="this">
      <![CDATA[//input[contains(@id,"cpMain_messagingMain_SendMessage_subjectTextBox")]]]>
    </xpath>
  </detect>

  <detect type="messageBody">
    <xpath name="node" extract="this">
      <![CDATA[//textarea[contains(@id,"cpMain_messagingMain_SendMessage_bodyTextBox")]]]>
    </xpath>
  </detect>
</service>
