Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;YouTube Info 1.2
- ;By Neo Nemesis
- alias youtube {
- %ytube1 = $remove($1,http://,www.,youtube,.com)
- sockopen youtube www.youtube.com 80
- }
- on *:SOCKOPEN:youtube: {
- sockwrite -n $sockname GET %ytube1 HTTP/1.1
- sockwrite -n $sockname Host: www.youtube.com
- sockwrite -n $sockname Connection: Keep-Alive
- sockwrite -n $sockname Content-Type: text/html
- sockwrite -n $sockname $crlf
- }
- on *:SOCKREAD:youtube: {
- sockread %ytube2
- if (%ytube2 == $null) && (%sockread == $null) {
- msg %ytube3 1,0You0,4Tube15,1 Error receiving information.
- set %sockread 1
- }
- elseif (%ytube2 == $null) && (%sockread != $null) { noop }
- elseif (<meta name="title" content=" isin %ytube2) {
- msg %ytube3 1,0You0,4Tube15,1 $remove(%ytube2,<meta name="title" content=",">,&quot;)
- }
- }
- on *:TEXT:*youtube*:#: {
- %ytube3 = $chan
- %ytube4 = 1
- while ([ $chr(36) $+ [ %ytube4 ] ]) {
- if (www.youtube.com/watch?v= isin [ $chr(36) $+ [ %ytube4 ] ]) {
- sockclose youtube
- youtube [ $chr(36) $+ [ %ytube4 ] ]
- }
- inc %ytube4
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement