Closed ghost closed 11 years ago
Did you test it ?
no, this is the code that I got from Issue #210
It's not even close to look like coffeescript code.
It's not even close to being correct. Please stop. Do not attempt to patch the TTAPI, thank you, drive through...
@alaingilbert what do you use to compile your coffeescript code?
I use coffee-script. In order to contribute, follow the steps:
npm install
will install coffee-script
make
will compile the src/
folder to lib/
When I want to test, this is what I do :
dev.coffee
repl = require('repl')
Bot = require('./Turntable-API/src/bot').Bot
bot = new Bot 'xxx', 'xxx', 'xxx'
bot.debug = true
repl.start('> ').context.bot = bot
prod.coffee
repl = require('repl')
Bot = require('./Turntable-API/lib/bot').Bot
bot = new Bot 'xxx', 'xxx', 'xxx'
bot.debug = true
repl.start('> ').context.bot = bot
And my architecture looks like :
|-- dev.coffee
|-- prod.coffee
|-- Turntable-API
|-- Makefile
|-- src
|-- lib
|-- ...
Basically, dev.coffee
will let you work with the coffee-script ttapi
and prod.coffee
will use the compiled sources. (If you want to make sure everything still work when compiled)
If you want to execute your bot in coffeescript...
npm install -g coffee-script
then:
coffee dev.coffee
That's it... you're not obligated to compile the sources...
Cool thank you @alaingilbert! I'll try that out tonight. FYI you have some id info you might want to remove ^
I guess the npm install
when run in your local directory, figures out what needs to be installed locally. In this case the coffee-script compiler. ...and the npm install -g coffee-script
installs it so you can run it in any directory ( -g = global ). Good to know.
https://npmjs.org/doc/install.html
@Turntablelover The code I posted was from the tt.fm JS. It will not work, it is not even coffee script o_0
@alaingilbert btw make
wasn't working for me, probably because I'm using git bash on a windows machine. I had to use coffee -c bot.coffee
in the src
directory to compile the bot.coffee
to bot.js
for testing purposes. Doing it this way obviously puts the compiled output in the src
directory, but it's pretty easy to copy it to the right place for testing.
@DubbyTT if make
doesn't work, you can compile the sources with :
./node_modules/.bin/coffee -pc src/bot.coffee > lib/bot.js
Anyway, I'll probably change the makefile for a cakefile. so it'll work on windows too.
I finally got Git working again so here's a pull request that has support for Turntable.fm's new features.
A: Get Fan Info B: Get Fan Of Info