;@@@ ;@@@ DreamBot IRC Bot 5.4 ;@@@ File description: fun :) ;@@@ Design & coding: DreamBot development team ;@@@ (C) Copyright 2004-2006 DreamBot development team. All rights reserved. ;@@@ ; youtube video search ; returns the first search result for your search terms ; usage for other people ; ; triggers: !youtube ; syntax: @youtube ; example: !youtube cyrpess hill ; if you want to sort search by VIEW COUNT, use this line below ; sockwrite -nt $sockname GET /results?search_sort=video_view_count&search_query= $+ %searchstring ; ; if you want the regular search, use this line below ; sockwrite -nt $sockname GET /results?search_query= $+ %searchstring HTTP//1.1 ; ; the place im referring to is: under the heading on *:sockopen:ytsearch:{ alias yt { %channel = $chan if (%channel) { %saystyle = echo -t %channel } else { %saystyle = echo -at } %searchstring = $replace($1-,$chr(32),+) sockclose ytsearch sockopen ytsearch www.youtube.com 80 } on $*:TEXT:/^[!@](youtube) */Si:#: { msg $chan 1You4,40Tube 0,01 Results: %channel = $chan %saystyle = /msg %channel %searchstring = $replace($2-,$chr(32),+) if ($2 == $null) { %saystyle Search could not be completed | halt } sockclose ytsearch sockopen ytsearch www.youtube.com 80 } on *:sockopen:ytsearch:{ sockwrite -nt $sockname GET /results?search_query= $+ %searchstring HTTP//1.1 sockwrite -nt $sockname Host: youtube.com sockwrite -nt $sockname $crlf $crlf } on *:sockread:ytsearch:{ sockread -n %temp if (%founddesc_be) { unset %founddesc_be | %desc_be = $replace($remove(%temp, ),
,$chr(32)) } if (]+>(.+?)/,1),
, ),",$chr(34)) } if (
isin %temp) { %foundtitle = k | %titlecounter = 0 } if (