Public paste
Undefined
By: biggie | Date: Jan 11 2007 13:45 | Format: None | Expires: never | Size: 1.48 KB | Hits: 1413

  1. alias warenhuis-gaming {
  2.   if ($sock(warenhuis-gaming.net)) { echo $colour(info) -ea warenhuis-gaming.net >> /warenhuis-gaming.net.net is already in use! | return }
  3.   if (($1) && ($1 !isnum) && (!$istok(news,$1,32))) { echo $colour(info) -ea warenhuis-gaming.net >> $+(",$1,") is an invalid type. | return }
  4.   set %wnet.type $iif($1 !isnum,$1)
  5.   set %wnet.limit $iif($1 isnum,$1,$2)
  6.   sockopen warenhuis-gaming www.warenhuis-gaming.net 80
  7. }
  8.  
  9. on *:sockopen:warenhuis-gaming: {
  10.   sockwrite -n $sockname GET $+(/v2/rss.php?type=,%wnet.type,&limit=,%wnet.limit) HTTP/1.1
  11.   sockwrite -n $sockname Host: $sock($sockname).ip
  12.   sockwrite -n $sockname Accept: */*
  13.   sockwrite -n $sockname Connection: close
  14.   sockwrite -n $sockname $crlf
  15. }
  16.  
  17. on *:sockread:warenhuis-gaming:{
  18.   var %wnet.data
  19.   sockread %wnet.data
  20.   if ($regex(%wnet.data,/</channel>/i)) set %wnet 1
  21.   if ($regex(%wnet.data,/<title>(.*)</title>/i) && (%wnet)) .signal -n warenhuis-gaming title: $regml(1)
  22.   if ($regex(%wnet.data,/<link>(.*)</link>/i) && (%wnet)) .signal -n warenhuis-gaming url: $+($chr(31),$chr(3),$colour(info),$replace($regml(1),$sock($sockname).ip,www.warenhuis-gaming.net),$chr(15))
  23.   if ($regex(%wnet.data,/<description>(.*)</description>/i) && (%wnet)) .signal -n warenhuis-gaming desc: $regml(1)
  24.   if ($regex(%wnet.data,/</item>/i) && (%wnet)) linesep -a
  25.   ;echo -a mnet -> %mnet.data
  26. }
  27.  
  28. on *:sockclose:warenhuis-gaming:unset %wnet*
  29. on *:signal:warenhuis-gaming:echo $colour(own) -a $signal >> $1-
  30.