Formatting of code : You can (and must) use [ tcl ] an [ /tcl ] tags (without spaces in tags) to format your TCL codes and have syntax coloration x


Spotify/Soundcloud tcl
#1
hi all,

is there any tcl script that gets the music from spotify or soundcloud and relay it to the irc channel?


thank you in advance.
  Reply
#2
Not sure to understand. What do you want to relay exactly ?
I don't know how spotify or soundclound works, but I doubt you can have a feed with the actual music you're listening
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
  Reply
#3
yes @ CrazyCat i mean to feed it in the irc channel based on your music collection in soundcloud or spotify.
  Reply
#4
As previously said, I don't know/use spotify nor soundcloud, so you have to provide urls of the feeds, or to the API documentation) if you want some help.
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
  Reply
#5
@ CrazyCat please take a look at this link below;

Soundclound API: https://developers.soundcloud.com/docs/a...r/open-api
Spotify: https://developer.spotify.com/documentation/web-api/

hope this works..
  Reply
#6
it takes a little autonomy and research on your part, trying to work on the beginning of the script, and when you get stuck on a part, we can help you.
  Reply
#7
here, i found this from the other forum.



Code:
# spotify.tcl
# by doggo #omgwtfnzbs@EFNET
#############################

set logo "\002\00300,03 Spotify \017"

proc spotify:announce {nick uhost hand chan text} {
global logo

   if {[channel get $chan spotify] != 1 } { return }           

   if {[regexp -nocase {http://open.spotify.com/track/([A-Za-z0-9]+)} $text match spotify]} {

   set html [spotify:getdata "http://open.spotify.com/track/$spotify"]
  
   regexp -nocase {<meta property="og:description" content="(.*?), a song by\s(.*?)\son Spotify." />} $html match title artist

   if {![info exists title]} {
   putlog "\[spotify\] unable to get title/artist info from: http://open.spotify.com/track/$spotify"
   } else {
   putlog "\[spotify\] fetching: http://open.spotify.com/track/$spotify"
   puthelp "privmsg $chan :$logo $artist - $title"
  }
}
}


proc spotify:getdata {data} {
   ::http::config -useragent "Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.8.1) Gecko/2006101023 Firefox/2.0"
   set url [::http::geturl $data -timeout 5000]
   set source_code [::http::data $url]
   ::http::cleanup $source_code
   return $source_code
}


package require http
setudef flag spotify
bind pubm -|- "% *http://open.spotify.com/track/*" spotify:announce

putlog "spotify.tcl loaded!"

i tried it in my bot.. but nothing happen.

If we can start here.. a big thanks to all of you.
  Reply
#8
This seems to be a really old script as it doesn't use https.
And if I well understand, the way is to have a script which will retrieve spotify or soundcloud urls given by users in a channel and display info about the track/playlist ?

Your initial post wasn't clear.
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
  Reply
#9
sorry about that @ CrazyCat if it is not clear..

this is similar to mp3.tcl but it will get the data from spotify or soundcloud.
  Reply
#10
Well, mp3.tcl is just an anti-idle announcing random title from a list, nothing similar to any thing which can be done with the spotify or soundcloud API.
the API allows to get info about a particular playlist or track, and the script you show us do the same: it reacts to a spotify url and (when working) returns info about this specified track.
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)