Alright, so I recently added a !SongRequest to my Twitch Channel, and people seem to like it. But I would like to add it so I could have them know what song was added, and even have it written in the file.

So, if I do
!songrequest https://www.youtube.com/watch?v=uuwfgXD8qV8

The Bot would reply with

The Song Katy Perry - Part Of Me has been added to my playlist

or

The Song, Katy Perry - Part of me is already in my playlist.

Then in the file it would look like this

$nick: Katy Perry - Part of me: https://www.youtube.com/watch?v=uuwfgXD8qV8

Here is my first script

Code:

on *:TEXT:!songrequest *:#ifstudios: {
  if ($read(songrequest.txt,nw,https://www.youtube.com/watch?v= $+ $2)) { 
    msg # $nick --> That song is already on my list :)
  }
  elseif (youtube isin $2-) {
    msg # $nick --> Please request the letters and numbers after the "Watch?v=" so "!songrequest 0KSOMA3QBU0"
  }
  else {
    msg # $nick --> I have added your song to my list.
    write songrequest.txt $nick $+ : https://www.youtube.com/watch?v= $+ $2
  }
}



and here is the code that I am trying to blend into the script

Code:
alias -l sockopenmark { sockopen $1-3 | sockmark $1 $4- }
on $*:text:/(youtube\.com)\/.*v=([^&]+)|(youtu\.be)\/(.+)/Si:*: {
  sockopenmark $+(yt.,$calc($ticks + $rand(1,99)))  www.youtube.com 80 $regml(2) msg $iif($chan,$v1,$nick))
}
on *:sockopen:yt.*:{
  tokenize 32 $sock($sockname).mark
  sockwrite -n $sockname GET /watch?v= $+ $1 HTTP/1.0 
  sockwrite -n $sockname HOST: www.youtube.com $+ $str($crlf,2)
}
on *:sockread:yt.*:{
  var %v  |  sockread %v
  if ($regex(%v,/"name" content="(.+)"/)) { 
    tokenize 32 $sock($sockname).mark
    $2-4 $replace($regml(1),&,$chr(38),',$chr(39),',$chr(39),",$chr(34),",$chr(34),&,$chr(38)) $5-
    sockclose $sockname
  }
}



I do things with stuff that makes other things do stuff.