atomjack / dubtrackapi

An API for creating bots on Dubtrack.fm
22 stars 5 forks source link

Unable to run dubtrackapi #3

Open jtrutwin-zz opened 9 years ago

jtrutwin-zz commented 9 years ago

Hey Chris, thanks for the quick API release.

I have phantomjs 2.0.1-dev installed from git, phantom-node installed via NPM and node v4.1.1 installed:

$ phantomjs --version 2.0.1-development $ node --version v4.1.1

I copied your javascript from the main page, found my connect id, and changed to join indie-while-you-murder.

When I attempt to run though I get this error:

$ node netski.js connecting to indie-while-you-murder /home/jtrutwin/plugbot/dubtrack/dubtrackapi/index.js:207 this.page.evaluate(function() { ^

TypeError: this.page.evaluate is not a function at DubtrackAPI.getEvents (/home/jtrutwin/plugbot/dubtrack/dubtrackapi/index.js:207:17) at Object. (/home/jtrutwin/plugbot/dubtrack/netski.js:21:5) at Module._compile (module.js:434:26) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:475:10) at startup (node.js:117:18) at node.js:951:3

Any ideas?

I was logged in as the bot's account for a while but I logged out, but for some reason the user is still showing up in the room so I'm not sure if I have to wait a while before the account is no longer in the room?

Thanks,

Josh

jtrutwin-zz commented 9 years ago

Tried with node 0.10.40 as well - same results. Also tried on a completely different OS, same results again. The PhantomJS tests seem to work fine so I'm not sure what's going on with my installation.

atomjack commented 9 years ago

Oh I think I know what is going on. That error is being thrown from the call to bot.getEvents, but it's being called before the bot is finished connecting. My bad, I should have put that call inside the ready event. Comment out the call to getEvents and it should work for you (and you can put it inside the ready event to see the events you can hook).

atomjack commented 9 years ago

Also, the problem with users still showing up in the room even after they've left is a known bug in Dubtrack - it doesn't seem to remove users who have actually left (yet).