qbit / node-pushover

Pushover notifications for node.js (JavaScript,NodeJS)
ISC License
163 stars 24 forks source link

Sound not working & cmd line question #2

Closed industrialinternet closed 11 years ago

industrialinternet commented 11 years ago

Hi thanks for your library can't get sound option to work, though it does from curl. I'm very new to node running from cmd line on winnows using your example have use Ctrl C to exit after getting the status and request id: back from Pushover. Not sure why that is?

Thanks in advance Lawrence

qbit commented 11 years ago

Sorry about that - the recent update ( http://updates.pushover.net/post/45198796457/upcoming-api-change-application-token-required-for ) made passing ?token= a requirement.

I have published 0.1.4 to npm. Let me know if you have more issues!

qbit commented 11 years ago

@industrialinternet forgot the second part :P - that happens because in the lib I establish a setTimeout to update the sounds ( every 24 hours ) - I added a "process.exit(0)" to both test scripts.

industrialinternet commented 11 years ago

@qbit many thanks been testing and the sound option only works if send is wrapped in setTimeout of >= 700ms why would that be?

setTimeout( function() { p.send( msg, function( err, result ) { if ( err ) { throw err; } console.log( result ); process.exit(0); }); }, 700);

qbit commented 11 years ago

@industrialinternet It is making a request to get the list of sounds. I just pushed an update with local sounds in the lib.

You should be able to call .send() right a way with 0.1.5

industrialinternet commented 11 years ago

@qbit thanks again for the speedy response, I've been using Pushover for a bit it's just so good. Having developed simple prototypes with a closed server-side javascript framework I'm really enjoying node.

qbit commented 11 years ago

@industrialinternet glad you are enjoying it :D