crispymtn / crispyfi Goto Github PK
View Code? Open in Web Editor NEWMakes music. Loud. https://www.crispymtn.com/stories/let-the-music-play
Makes music. Loud. https://www.crispymtn.com/stories/let-the-music-play
It's running on 64 bit Ubuntu14.04, I create folder in root and copy/paste all of the source. I changed config.js and copy/paste my spotify_appkey.key into the this folder. Then run "npm install" command inside the folder, everything installed. Then run "npm start" and I get this error (I also tried with "node index" command):
/root/slackify/node_modules/coffee-script/lib/coffee-script/register.js:45
Module._extensions[extension](this, filename);
^
Error: /root/slackify/lib/spotify/mac/nodespotify.node: invalid ELF header
at Error (native)
at Module.load (/root/slackify/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/root/slackify/lib/spotify/mac/spotify.js:1:78)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (/root/slackify/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at module.exports (/root/slackify/lib/slack_interface/index.coffee:14:15)
at Object. (/root/slackify/index.js:11:60)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Hi,
I'm trying to write a plugin for Crispyfi, and I'm having a little trouble getting my head around node.js's asychronous operations. I want the handle to respond to a search request and give a list of potential matches with a Spotify link. Here's what I've got so far:
class SpotifySearch
constructor: () ->
@name = 'Search'
@response = null
search: (handler, request, callback) ->
search = new handler.spotify.Search(request)
search.execute (err, searchResult) ->
@str = ""
for track in searchResult.tracks
do ->
@str += "#{track.name} - #{track.link}\n"
callback @str
handle: (auth, handler, volume) ->
if auth.command == "search"
this.search handler, auth.args.join(" "), (response) ->
@response = response
else
return false
module.exports = () ->
return new SpotifySearch()
I've tried to use callbacks in the traditional node.js way, but the handler returns before the search completes (because asynchronous). Is there any way I can stop the handler returning until the search has returned? I've tried using promises, but am a bit over my head to be honest! Is there anything easy I'm missing?
I've just installed crispyfi on my mac, everything went smoothly to start with
i type
node index
and get
Loading Plugins...
...done.
Server running. Yay!
Logged in
this is my post data
POST /handle HTTP/1.1
Host: localhost:8000
Cache-Control: no-cache
token: XXXXXX
text: help
However it just times out, i added this into index.js
server.on('requestStart', function (pathname, time) {
console.info(' ☉ :: start :: %s', pathname)
}).on('requestEnd', function (pathname, time) {
console.info(' ☺ :: end :: %s in %dms', pathname, time)
}).on('error', function (pathname, err) {
console.info(' ☹ :: error :: %s (%s)', pathname, err.message)
}).on('timeout', function (pathname) {
console.info(' ☂ :: timedout :: %s', pathname)
})
and this kicks out
☂ :: timedout :: /handle
any suggestions?
Many thanks
New to ngrok- how would I go about implementing ngrok here? Just created an account at ngrok, but not seeing exactly how I would integrate with the service... Think you could point me in the right direction?
Installed libspotify , node etc all on rasberrypi. Cannot get it past this error.
node index
/home/pi/crispyfi/config.json
/home/pi/crispyfi/node_modules/apiserver/index.js
/home/pi/crispyfi/node_modules/apiserver/lib/apiserver.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/qs/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/qs/lib/querystring.js
/home/pi/crispyfi/node_modules/apiserver/lib/middleware/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/json-transport/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/json-transport/lib/json-transport.js
/home/pi/crispyfi/node_modules/apiserver/lib/middleware/httpauth.js
/home/pi/crispyfi/node_modules/apiserver/lib/middleware/payload-parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/bufferjoiner/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/bufferjoiner/lib/bufferjoiner.js
/home/pi/crispyfi/node_modules/apiserver/lib/middleware/multipart-parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/incoming_form.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/file.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/multipart_parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/querystring_parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/octet_parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/formidable/lib/json_parser.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/apiserver-router/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/apiserver-router/lib/router.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/apiserver-router/node_modules/xregexp/xregexp-all.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/fnchain/index.js
/home/pi/crispyfi/node_modules/apiserver/node_modules/fnchain/lib/fnchain.js
/home/pi/crispyfi/node_modules/apiserver/package.json
/home/pi/crispyfi/lib/slack_interface/index.coffee
/home/pi/crispyfi/lib/spotify/pi/spotify.js
/home/pi/crispyfi/lib/spotify/pi/nodespotify.node
/home/pi/crispyfi/node_modules/coffee-script/lib/coffee-script/register.js:46
Module._extensions[extension](this, filename);
^
Error: libspotify.so.12: cannot open shared object file: No such file or directory
at Module.load (/home/pi/crispyfi/node_modules/coffee-script/lib/coffee-script/register.js:46:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/pi/crispyfi/lib/spotify/pi/spotify.js:1:78)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/home/pi/crispyfi/node_modules/coffee-script/lib/coffee-script/register.js:46:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at module.exports (/home/pi/crispyfi/lib/slack_interface/index.coffee:12:15)
at Object. (/home/pi/crispyfi/index.js:11:60)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
Passed in a Spotify playlist uri and it crashed the app:
play spotify:user:natecook7:playlist:7p0wjqToNjHfu4bzLvY3Vk
Returns:
/home/pi/Apps/crispyfi/lib/spotify_handler.coffee:141
.track.index = ++this.state.track.index % this.state.playlist.object.numTracks
^
TypeError: Cannot read property 'numTracks' of null
at SpotifyHandler.get_next_track (/home/pi/Apps/crispyfi/lib/spotify_handler.coffee:164:73)
at SpotifyHandler.skip (/home/pi/Apps/crispyfi/lib/spotify_handler.coffee:102:12)
at IncomingMessage.<anonymous> (/home/pi/Apps/crispyfi/lib/slack_interface/request_handler.coffee:21:41)
at IncomingMessage.g (events.js:180:16)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:442:13)
Remove playlists from the configuration and handle them via persistent storage (node-persist?) instead. Administration can be handled via Slack in the form of list add/remove/rename <name> <spotify uri>
etc. Would also allow for on-the-fly playback of a certain list, similar to how play
currently works.
Hi there,
First off – great product, thanks for the work :)
This is the issue I've encountered:
/home/pi/crispyfi/lib/spotify_handler.coffee:4352: Uncaught Error: Track not playable
We're based down in New Zealand and I'm guessing if the player hits a song that's been region blocked it throws this error. what would be great is if rather than causing this error it could be caught and simply skip to the next track?
Thanks!
Darren
Hi,
I've installed crispyfi on Raspberry and there was two issues I saw. One of them Error: libspotify.so.12: cannot open shared object file: No such file or directory
and I resolved that issue as like explained in here FrontierPsychiatrist/node-spotify#43 (comment)
The other one is {"success":false,"reason":"/ api not found"}
but couldn't understand what is wrong with it. I see Logged in message in terminal btw,
$ node index
Loading Plugins...
...done.
Server running. Yay!
Logged in
Ran npm start
and receive no output in the command line
I'm trying to run this on my OSX machine
I've got a spotify_appkey.key
in the repos root and I've filled in the configs in the config.json
Is there something anyone can do to help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.