Youtube Titlefinder

By PowerScripters on Jan 09, 2010

################################
Connects the Youtube-Page if somebody types YoutubeURL.
Ready the Meta-Title Name and posts to the Channel.

Screenshot:
Image

alias xconnection { set %tmpx $remove($1,http://,youtube,.com,www.) | sockopen youtube youtube.com 80 }
on *:SOCKOPEN:youtube:{

  ; connection
  sockwrite -n $sockname GET %tmpx HTTP/1.1

  ; Write Connection Details
  sockwrite -n $sockname Host: www.youtube.com
  sockwrite -n $sockname User-Agent: IRCSpider/mIRC $version
  sockwrite -n $sockname Accept: *.*, */*
  sockwrite -n $sockname Referer: $server
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname Content-Type: text/html
  sockwrite -n $sockname $crlf 

}
on *:SOCKREAD:youtube:{
  sockread %mirc.temp
  if (<meta name="title" content=" isin %mirc.temp) {
    if (%d == 1) { }
    else {
      msg %tmp.chan 01You0,4Tube: $remove(%mirc.temp,<meta name="title" content=",">)
      inc %d
    }
  }
}
on *:SOCKCLOSE:youtube:{ /noop }
on *:TEXT:*:#:{
  set %tmp.chan $chan
  unset %d
  var %i 1
  while ([ $chr(36) $+ [ %i ]  ]) {
    if (youtube.com/watch?v= isin [ $chr(36) $+ [ %i ]  ]) { sockclose youtube | xconnection [ $chr(36) $+ [ %i ]  ] }
    inc %i
  }
}

Comments

Sign in to comment.
StevieW   -  May 29, 2011

Tried it myself but couldn't complete. Any chance we can update this with the youtu.be shortcut links? Also, i can't connect to your irc server.

 Respond  
PowerScripters   -  Jan 09, 2010

PS are scripting the whole day!: )

Want to join the PS?

connect to powerirc.homeip.net:6667 channel #ps
Contact Shiny or lol538
(U can contact lol538[Off] too

Some users use the [PS] tag

If u want to join Please use the [PS] tag before your nick

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.