All pastes #145354 Raw Edit

Untitled

public text v1 · immutable
#145354 ·published 2006-08-22 23:09 UTC
rendered paste body
on *:text:?myspace *:#: { set %my.chan $chan | myspace $2 }
alias myspace {
  sockclose myspace- $+ $replace($1-,$chr(32),+)
  sockopen myspace- $+ $replace($1-,$chr(32),+) myspace.com 80
}
on *:SOCKOPEN:myspace*:{
  sockwrite -n $sockname GET / $+ $gettok($sockname,2-,45) HTTP/1.1
  sockwrite -n $sockname Host: myspace.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname User-Agent: Mozilla/3.0 (compatible)
  sockwrite -n $sockname Authorization: Basic <uu-encoded>
  sockwrite -n $sockname $crlf
}
on *:sockread:myspace*: {
  var %temp
  sockread %temp
  if (%temp) {
    if (maintenance isin %temp) && ($remove($gettok($gettok(%temp,1,62),1,60),    )) {
      msg $active $remove($gettok($gettok(%temp,1,62),1,60),    )
    }
    if (%my.x == 3) {
      set %my.link %temp
      unset %my.x
    }
    if (%my.x == 2) {
      set %my.quote $remove(%temp,    )
      set %my.x 3
    }
    if (%my.x == 1) {
      set %my.x 2
    }
    if (<title> isin %temp) {
      set %my.x 1
    }
    if (MySpace Profile isin %temp) {
      set %my.loc $gettok($gettok(%temp,8,34),2-4,44)
    }
    if (id="ctl00_Main isin %temp) && (  isin %temp) && (!%my.t) {
      set %my.1 $gettok($gettok(%temp,2,62),1,60)
      set %my.t 1
    }
    if (%my.y == 2) {
      set %my.lastcr %temp
      unset %my.y
      set %my.fc 1
    }
    if (%my.y == 1) {
      set %my.y 2
    }
    if (FF9933 isin %temp) && (%my.fc != 1) && (center isin %temp) {
      set %my.y 1
    }
    if (%my.cm == 4) {
      set %my.lastc $nohtml($iif($len(%temp) < 300,%temp,$left(%temp,300) $+ ...))
      unset %my.cm
      set %my.fcc 1
    }
    if (%my.cm == 3) set %my.cm 4
    if (%my.cm == 2) set %my.cm 3
    if (%my.cm == 1) set %my.cm 2
    if (*/*/* * PM iswm %temp) || (*/*/* * AM iswm %temp) && (!%my.fcc) {
      set %my.cm 1
    }
    if (displaying isin %temp) && (of isin %temp) { set %my.com $gettok($gettok(%temp,5,62),1,60) | set  %my.zx 1 }
    if (friends isin %temp) && (has isin %temp) { set %my.friends $gettok($gettok(%temp,2,62),1,60) }
    if (<td width="193" isin %temp) { set %my.x 1 }
    if (</html> isin %temp) {
      if (%my.loc) msg %my.chan 10,0(1 MySpace10:1 Link10:1 www.myspace.com/ $+ $gettok($sockname,2-,45) $+ 10 ) (1  Top Friend10:1 $&re(%my.1) $+ 10 ) (1 Basic Information10:1 %my.loc $+ 10 ) (1 Quote10:1 %my.quote $+ 10 ) (1 Total friends10:1 %my.friends $+ 10 ) (1 Total comments10:1 %my.com $+ 10 )
      if (%my.loc) && (%my.com)  msg %my.chan 10(1 Last comment posted by10:1 $&re(%my.lastcr $+ ; %my.lastc) $+ 10 ) 
      if (!%my.loc) sockwrite -n bot* privmsg %my.chan :No vaild information available
      unset %my.*
    }
  }
}