LG-Gaming Marathon
Would you like to react to this message? Create an account in a few clicks or log in to continue.


LG-Gaming Marathon Server hosted by LGrobert
 
HomeSearchLatest imagesRegisterLog in

 

 Produkt search

Go down 
AuthorMessage
LGrobert
Elite Newbie
LGrobert


Male Number of posts : 40
Age : 37
Status : Founder
Points : 9
Registration date : 2008-09-30

Produkt search Empty
PostSubject: Produkt search   Produkt search Icon_minitimeWed Dec 03, 2008 1:44 pm

type !produkt <word> to see where you can by it and the price.

Code:
on $*:TEXT:/^[.!@](prod(uct)?)/Si:#:{
  set %p.chan $chan
  product $2-
}
alias product {
  if ($sock(product)) {
    %pmsg Please wait until the current search is finished.
    halt
  }
  set %pmsg $iif(%p.chan,msg %p.chan,echo -a)
  if (!$1) {
    %pmsg Syntax: $iif(%p.chan,!,/) $+ product [product name]
    halt
  }
  set %p.search $1-
  $iif(%p.chan,describe %p.chan searches,echo -a Searching) for $qt(%p.search) in Hawkee Price Comparison...
  sockopen product www.hawkee.com 80
}
on *:sockopen:product:{
  sockwrite -nt $sockname GET /shop/search/ $+ $replace(%p.search,$chr(32),+) $+ / HTTP/1.1
  sockwrite -nt $sockname Host: www.hawkee.com
  sockwrite -nt $sockname $crlf
}
on *:sockread:product:{
  var %x
  sockread %x
  if (no products found isin %x) {
    %pmsg No products found for $qt(%p.search) $+ .
    sockclose $sockname
    unset %p.* %pmsg
  }
  if ($regex(%x,/<a href="(\/shop\/prod\/\d+\/)" class='large'>(.+)<\/a><br>/i)) {
    set %p.url http://www.hawkee.com $+ $regml(1)
    set %p.prod $regml(2)
  }
  if (<div style='height: 37px;'> isin %x) {
    sockread %x
    set %p.brand $remove(%x,$chr(9))
  }
  if ($regex(%x,/<img src='\/shop\/images\/rating_set\.gif'>/i)) inc %p.rating
  if ($regex(%x,/<a href="\/shop\/prod\/\d+\/" class="large">(\$.+)<\/font>/i)) {
    %pmsg 9• 4Product: %p.prod 4Brand: %p.brand 4Price: $regml(1) 4Rating: $iif(%p.rating,$v1,0) $+ /5 4URL: %p.url
    inc %N
    if (%N == 3) {
      sockclose $sockname
      unset %p.* %N %pmsg
    }
    unset %p.*
  }
}
Back to top Go down
http://lg-gaming.com
 
Produkt search
Back to top 
Page 1 of 1
 Similar topics
-
» torrent search
» Video search on youtube

Permissions in this forum:You cannot reply to topics in this forum
LG-Gaming Marathon :: Server :: Scripts-
Jump to: