{"_id":"ttapi","_rev":"198-827a7b4a4fe300a49a136827d667e021","name":"ttapi","description":"A turntable.fm API","dist-tags":{"latest":"4.0.3"},"versions":{"0.0.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.0","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"8f03c0e881fc992e7400322166cc86eb742a6e44","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.0.tgz","integrity":"sha512-gDdMvUdUnnYhaa5LgtDR9vMNp9BLJpSwEICvsjOn9z/MR/DJi4N7aLhgWsB6QIINqxwkqbsGOtJchM3LmcdxXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMGG4nRQr4R9see3PhSsMsY4Da6a8PVZTNzJidW9ykWAiEA6sQDJTw/t4vjjWPuR5hoaTaAYJnCqeIF+Sig1kd4YgY="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.0.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.1","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"4a7d2ba9d912b1e7018a9077fc5d0d4653b59abc","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.1.tgz","integrity":"sha512-P+9qww68PjKfzmQfDFWVHgDUu0+bzM7PbgIbUe8hON8xN+BpDiYPKGFN7BnEX6yMQa8ZlxXnu2jKEwpZJyREYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzly8utp2ZCzI87cXCOa5/kkjrOkiffTJA4ovJfzr8DgIgWYSh4MOtaIgerEPhCo66a7g+NvEYoItpti31AlLby6g="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.0.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.2","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"0d9aba7350242dd88f592f911bc24dab573853b4","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.2.tgz","integrity":"sha512-NaHE72De6x6tp0WkJKIA0zaYMqFEcE2Pz+RD9oJxSiLJ7n4GRpr5n7IYAd4EsQ/XJBoMy9tS198padBfNjKy0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2ilD2uAYDalpG/Z2QnO6nxWmE3/83LmGzh8R2XH393AIhALBE+PAZ/OTv+zfPp/1uYj4HtZcAXCs4xFyZwHndzeko"}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.0.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.3","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"418e6d5a504c3804b12cecfbea3c2de8e7e74c59","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.3.tgz","integrity":"sha512-mAwCX+3y3YXZrCXtRGG1DSzqOciqkzK5lUuRCpDtCWMgFhgILKuoWWs3u+Km+6pJTsutUtsJ/IoyQsUuawAvMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbb06wJi2Uv7XsvuwljyDR1hC5iRIKmtTukn1InCC5tAiEAz/ZO+g9V6ZrkUiUkZWWmwRuvQDNUkhQVMd42Vsd4dnI="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.0.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.4","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"352268b6fd83feb036b566f37ea2a8cf59358e72","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.4.tgz","integrity":"sha512-+QKF1EKeshVIkuT73t5s3EPe4UE1IO0vN86BAaerG9ZW5WqPEpKgge9/gEXjscedk47FrNYo40yi5Jd9ok/WMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6fX9RLiT9Wv0IBpMJD5LJflfecnNy5y135hl9PZs5HAiEA39GfFYXs/iirUjKe67buUOKG1BvXGaMsnDMW87wHzvY="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.0.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.0.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.0.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.0.5","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"e6f7041a4c382594881c847d614a39f18a82a8fd","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.0.5.tgz","integrity":"sha512-RIvrx4Qfc24FuYcsaucXlj/A3q9q72Ovmarx8CXkJh361Sa7/sL9QdJqasxRkELi1IDM3LXBhdIQvOAz19WaNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFIjUnUEUUOIwmewmeoqJ10NZzNsPqWwk13wnWka7sSAiBXKTNQULzxmfBNTBEJuUkzjaHk5vbogX7Cgboxdv3q4w=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.1.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.1.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.1.0/package/package.json","wscript":false,"serverjs":false,"contributors":false},"_id":"ttapi@0.1.0","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"93898259f8c369f9dbde56c62fa55982e3f005a2","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.1.0.tgz","integrity":"sha512-Tn2Uop32SrQIrpeKFVrISrzGXL5cRVNnQ+N+v37HK7WgLbw4roWX4qQfjVIbj0s1hGZ6FkeZe6velZ2CIUzqjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfbvZkbK5WsGzVM/KWgg3xd24TeHITlKgaNLIr17B72QIgZhvinqT1UnDeYHd7i6t75mzP1T09NoloKuz3gRpd2zo="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.0","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"d4cbc13e35e121f19870345a7ca481994acf74b3","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.0.tgz","integrity":"sha512-Xnqk6farsJX0vhGgQUZ2vz5vcSkmRXS8Dk1NYktStr2wkkKUJmyUh3MIyp5MNtwsYTdhmMbI+waLcCTeFv+9Dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+hZ2WY2JeawXcssVyQbA5eKzRMF19SpBSXhJfhMNJiAiAvMU0YsEovAPy5r7G7lLJhi9VNANBONCVSx/YARaClpQ=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.1","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"bc0d90bd9e1bc3830cc26becdd348cb76acdce4d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.1.tgz","integrity":"sha512-wVORorCquWtfzc1QxGc/dBYx4OBpRtq/VB+d8JFDJ1fElypB1pFfJxmelFLvgsD+3R291pioq73GnYF0JVm1wQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPk281qHe+codL3cFXcTQlukfhjzzyKhpdBDpS6gYSuAiEA+TAlR2CWSYf/Yh61WDU9zTiW5fG6ROsHBpR8QMCZnz4="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.2","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"b389225c17c7631af05bcb105f0314a0ce4187ad","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.2.tgz","integrity":"sha512-CQ7I1c28KgRCYjWLlwH+nkGwsGELRt14lvkOfmtFMAdae9ZtkjeyZs/ZYbfY5gOKYevGEZkyt3j5jfww+6eXxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBfRAkot5GFbmZJxD9ve0Ls9CNXBmviK7PxvDhZUNae4AiEAxn9gXFljDbVU7j9etnrvdhEHdRM0fSZ1q1Z1rim/tnA="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.3","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"b40634b68f54d01aed38068f97373e37b426c22b","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.3.tgz","integrity":"sha512-n7CAfNhd7TW0J8PhLuiPNrDutIS6V1yqm4lM3PpUEzmwtanODUTKrnUOg64BJmkTdUk1dTRb5xQiSpG1M7ZlkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiCXLqo4KbCkt9XHjnVK5EWgxOQfqcK+2NBrK6+0lw5AiEAn30Vyx5IZa9W+h4sZ5CSt5KYV4IuDc4zQxJHWBMcXiI="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.4","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"262a7cef2e0a090dfd6e98c50fd7d1e14f74f516","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.4.tgz","integrity":"sha512-aUoYSbkjBUGE8upKeGx0FjQQtfYu8wW4AYmKEHshcQqyaG+EOg4ivjn/vf/EWU15Y6ENhr9pwd3cmVyYgPSdyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7R5H8ncuZcsr7vAqQx45jfR2NHStyqUcR2CVtqL9dxAiBUoSXNVwyTes4CBvBXYMiE0mvgZIXzo0n1ctPigpVbBQ=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.5","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"cb345a18fd3540792f7b9dc93b9d9e1716bf1f6d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.5.tgz","integrity":"sha512-Vfvbt3Ti7wg5g9UZnX/NEWgdACOA1e/TY4SpLruj6YhkiOVcU1c8KF4oVolO87H8s7cfJ4iz8dWBgdZ4Ua3WFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzUdHWsIuLPeBmlLq+8fa7ytOnK5Pi7OxuthmKcdGojgIgG7l6CUSSLjpss5jXNAliWjw80kVU6zWNIalUVzg8+iU="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.6/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.6","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"9003d023d8a94c7c45b5a035e1fa647164d76f7a","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.6.tgz","integrity":"sha512-fFhw3izrd7snd50vgJOe/JpXLpYZHhdZxRW987dxgyGk7Gxc0QqY4qpW/Pmmhko0WUan86bkd4JN/2X5i7Oc8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBE6DIn9e014n+CXG2az4tTIWdGp7ur4Vv5BwHcUE3+1AiBYhv+yXtlgrDsOaO9qTvnKMig089ZgASbHfab9337zzA=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.7":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.7","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.7/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.7","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"0bde477582f5ff06441cfc7eacbbe75df4c8c3b5","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.7.tgz","integrity":"sha512-sQr37zKRX83gCRICm6voSp/W3j/mVqnkSOyeff/Aus+ghnf0TwFNASC9XDCnhjMPT9FkJxwIr37borGYbi/8hQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnj9Qbf2TlDqMAVu9OmMuZtiTWhnT0/HO98db3zQnf7AiAEZLo94c6vwFiEy0/k1nBr4q9jGEevFIqJ8/wfOWz4Mg=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.2.8":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.2.8","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.2.8/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.2.8","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"93342504b318502bc2879d2f1e17a2a7d4828e55","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.2.8.tgz","integrity":"sha512-xfsLuc2msBSegf/Ik88dZd7Tk1jWXFqOKpHP05prRtGTE3BIAYPa29tZ29l37HzMNg4b3EOXQIS91iDj6wZ+NQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBlsQmLHUysv75SG4TCkyf/nAP9iC2+gsSv9N5qwDs+QIgMQXo08v/YeM3tDpY8rDMAlFB+oOeyugM4SZtLCHcVow="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.3.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.3.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.3.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.3.0","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"ed2f9b6cef00451a9a0fc092e0c1442833733142","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.3.0.tgz","integrity":"sha512-6X24jow3SjdoiD2JAAOaJ0JwbAJr5Rn21AWP8cigH4i+8TjRL5dFNwh6DrCaQ8CeDMe9M/gkCZ7/cSLnpB0VzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFms8Na71lDhjHYIxn3T+GRxHBTWOpXfDVJLI92Os4FTAiAnGCrGnV2W2Xg1/ig3xDMeUVSD9MVKKlgUwCY4jV8J+g=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.3.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.3.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.3.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.3.1","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"543d20ab0caa4123b277119dc15cf1b5694da76b","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.3.1.tgz","integrity":"sha512-syU7u6MNNgofe3bVYGlEAFeJu9jcqiAM5bO7gs9VdLZAHyx4pDskilYOPyDqVjLGz7l88glEgfniM4QJNpWYYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB/Orr+/1siM5tARyVyQKPF1uBpoFB7VkMTkwHf4R1NXAiEA7ezKj6d8RkYwf1lGp6YNCdSSsCUXQqkkIp/P2ToL/18="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.3.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.3.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.3.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.3.2","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"a9548647b9a231c422fd26c0f83c7677f510814f","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.3.2.tgz","integrity":"sha512-imGILHe3KOycFm9JJOh1EG258oorGIq3+GXrtKE+H8VBK0EObMIeuwmntAG4jcSlYSqPf+UuYizK4j1M+tSCTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd4MExw/eO0F8qEJG7AKdW/ZF3Z2/jjUIF1o+i89faPwIgPypbe/rGrvWAZaGMPrlz6xC9SPjFvXkZmY6Hdxw3fsQ="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.3.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.3.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.3.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.3.3","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"231a5d8502cf43f4870c30329bb17981cb80cb86","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.3.3.tgz","integrity":"sha512-NZTg2u8ANwHYbpKD4tztA/Q2xtx8EzWkrPVj8pmBoADYOmo3gnf43mR5rdbYWq12Rk4fiwQC6tUaDmRCt77NIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF90Ph1CX31N8J1KSqWD+3pmuVzYs9Hp9kHhBqZcLuJ0AiBJzdevnYwKYid5KV6+V2ek/f7dgiUOyPAP9Tpg2gMQ8g=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.3.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.3.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.3.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.3.4","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"70c3932ae55500bb3d98ac661565d9662611ab18","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.3.4.tgz","integrity":"sha512-dPK6qvweTCYBvwx0BICIE97G0Q1nUu0VT1mVAAvA9TnVR7aIJSzsw6mHp9tR8ygr6qTvXH9tZMq8IKbMJDVOug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0i2ze/xwlG0XqUSciiZdeByhuxGUau/fGRlPjpVtjwAiBGEVEWM7SG7GZWGLNJbIeM+wSKkEqQHXq7zzlrCby5EA=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.0","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"341a95154e628172ddc426818316ffda51d55756","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.0.tgz","integrity":"sha512-y5r3GLXzQoL45nDRMFYw9I9asQnLB7TPORBHpj4ThIrC1rRsffKjcKiPfEp2FFnFsHKr7yUKknEu9qBxGDUAtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/QcjYQCxInTRuS0V/IDEj+gv6AijWaQ+fK7HK6Qf6xQIgIhcHAW29Y0ApQ0U1mKJZnoQL7F7p+vE0UqiMnCSRdU0="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.1","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"bea420a7064dc0191328cf7aae7d2fa33cc513a9","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.1.tgz","integrity":"sha512-S8tBnDgtv8GQRLmW7WPMZHj4tTYS0e7dJNqBA0M/v9oNgBHAPMBDK85h3G+BeYO5DtJL83Q/JQyMPIt/xhyCMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGD/yOicLcVUbBM9HgPjF+CQXHlGLTcTJc+PDbu6fsPeAiBmDq9ZVCPVb7RTXb7KhZHrYkXD6mVJnxpovX96Jl9s9w=="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.2","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"0d3f480d7b486add39c6ff024c6e9e0df95c9efa","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.2.tgz","integrity":"sha512-pZsxggMjlQvl9ycKLS8WZl/96IsSGXYU7jHXEul9xFfMbckDb/YHiTxdQhms/E33w76JORJwp3AIly8RGM439w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE5w42hWBSgi5xD5ND4MQu2vIMCkR7huAOYiPpLh5tPkAiEAuot4iblKcV2K+8LHTbOp8uLCROpd0i35KXz2wdA0zR0="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.3","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"46a76eeacdab55cd54cd4ea204b3e051813efae1","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.3.tgz","integrity":"sha512-Zlf2L5pVfgRFsRqUOtD2U/mIw4BuJfm29zUEptguT3yGnJyDTE2MwDZegmfQaJJmD9CRzvnm5w2NalRmirvfiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSZrN7mEqPPLzi+VV21mLteDqJDoOqHzhexJSuai4e8QIgQ1m7ndwwlRVdPwt3/yDx6WST6CFE0Z0pYcWiL1VRDls="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.4/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.4","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a2d6afb99b800416f03722ae8d6f236c94092b8c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.4.tgz","integrity":"sha512-ZADirwSppHXP0qDNxcQVeEt6c+8nr8Il2Uwp+yV8xoDFvH3+MzIV9GvYVfN5Dq1UnI/7yhZcq/IYeX9a25K4lQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwGt8y53xde4w/+XpF5JA1ojDJOEa1KTSBIg6f4XkV2AIhALoNdAIYMgTATKMHlVVrEKXnocYTOsVvPt/OWQGlqBfC"}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.8"},"dependencies":{},"devDependencies":{},"_npmJsonOpts":{"file":"/Users/alaingilbert/.npm/ttapi/0.4.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"ttapi@0.4.5","_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"af3568a15225bc438110d9b567805d5d429cc09d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.5.tgz","integrity":"sha512-huoteSPaJIaahm9GAeUyQKNBTcspSkZD6zfv+PS4H4zRJvwD/GLvfEYZx4JW2HydrIayZJJLZzLae2WHL0oiuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDayLNyPVDMgboyCXaCmnVYQkhc6QPF4TtH7UetEqFK1gIgJJ7sN5/zrPqRPyM8rftZzVEtofriz3R2YtJf3ZkU2dE="}]},"scripts":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"directories":{}},"0.4.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@0.4.6","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"2f738a2c3c5e9da00f8700a937dac7b0cd604cce","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.6.tgz","integrity":"sha512-r16XDlmg1XwhimUiA4c/VpHN2wsL5R0WrXMcXFk6QUAfGrw0pu/xE7B5UB4w3hlKk54e6/JyX+mvR7lKHstkeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbi74LjPldxMfSSadVOJxMb4W579wCV3lhbTJtztgb5gIhAKcHnKPL+kOaUQ3bNqnimxUszlKuKzips1nrlv78c7gY"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"0.4.7":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.7","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@0.4.7","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"149eb1bda71d98b9b6e2cdf4f02abf62462915ac","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.7.tgz","integrity":"sha512-W9wDl9LLFj7SDuLvWHHE0VeM9iZxDf6/t63seDl+nq7eDKItFz09XXdGzNqrxWEEsAbEUq+oD4zOXgPjMJ9t6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPNeZQTL3cFL+A5w1L86COYrvid8AcZ37INY3m/wW5cAiABuzwhqm+upI7sKakvcEmPaKceN5pe7EjMTdDeLpD/GQ=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"0.4.8":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"0.4.8","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@0.4.8","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"df07d254a9aa6bf92b24022edc7b613c9558e451","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-0.4.8.tgz","integrity":"sha512-V2KkMUWRBrXei37gFoqb5NGoK8cxICzIY7VghgLsl8tbpO34Oa1f/ibve4Ii8uOYD/xLWrNtn6KkCeJXXzhuEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDs75MzVbbjqlc9z7gyYyTUIhwU8LQWvzhWYaMnvRIx6QIfbXxsvqBuipID6wDfZacTQZAZd4RKZ1DVesbLcO42ag=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"f93262a93b7428d65e650886c4e628f71a4aebdf","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.0.tgz","integrity":"sha512-gKd0vpP/+eKsDwIFCS6Y7sJak6zymV49xPv+dy4yRDDSieI0jAWQeVCedzDC23QcQ9fHPm+eO4+GT1y0z2wA9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8EgoYIYU8TFKkz63OyAv47vPoa/VHfKdl0pcFdtwz2AIhAPyoD7PX8CAT6YXDwy04schzHVX0Vw/XVnPyu/KNua88"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"80046dccba32395b79229cc4b78512dd0e1a8da8","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.1.tgz","integrity":"sha512-w45wikXFfRN1WMkowtk312MwlBGhYHD5YdWkW7wlpj2UKtVuRRVBQQQS+d2YUucNPllo3HBBF6sCNgsk5AqPKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+2jGsxvCjEa5VDp3iIUZ6lMXlalSo5CVX+O4tvh96nAiEAsY0YnJf8BoRjqkEzhr/vIG4hkS+cdJRcFiziMHWScYE="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"34e0aeb136cb9aebd016b324c89a787c1c36b12a","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.2.tgz","integrity":"sha512-ES0oC1mIXA5e2NadoEnf29SB6SSGy4wGg+jnCs897cyfwzVuFNF7XSBhrcOdjOSHPLnlMzWiKWbgKi1SaJGbjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsmf1vlhiPnuK7xNvm8WZV14KW7uPJdiGoLs+SbUOTcAIgPOR18EygI6NSmPvKk8+D7zu6466yqIUMSKkRVsU30vw="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.3","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"dbcc7fbae04ef9555dd135b968e6f3eb40c78f3c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.3.tgz","integrity":"sha512-3PUWHSaN3DdZ/TBFBfeVCVG96b03sy4PK92IlmOb8t8JMOt8S9f1bsbFrcYny8Abha8HOYpGAuMyyAPUuMVcmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYs9ddfTMvQGSIAR3eHxG1CyGj/qRhvGOvvsvZYCIajAiB3iKyAaQ0VV+wAGAYXidW1mEwHQfiMxp+6RF6gwC9VKg=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.4","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"44d6252830a9c8a9973741a5de2c3bb040350af6","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.4.tgz","integrity":"sha512-REnp3WAssNBoCdKSlCgJgYhi/2aIwy+DpNJhXallRgMgPGnJuX0UReYSRpC6TjMOCotiKEvOL/A5tIE9MEq8aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRo1I/PfL5GrEJKoWz9rq1FQl23J+1HUuEV+634rN3eAIhAI76u+v1Qwp1Y66TAa105iNBlMibs4EceI+l+jGMyIkt"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.5","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"848510b6b5d519c9b37a177da7875e8161bca58c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.5.tgz","integrity":"sha512-+NMqMG6gZWrWP/as2ui+Ifa5sjMlaH9DpJZQ8VcjMVip5gKmApskfEHuqfG7959GieyqiEtdA5l2lrtwKIN5ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYI1fkmUEy1tKXoLOUKRon6h1Sr6pUcrVVEnF5fwtNygIgW/V6sQwSpM+r4UAgSlhqunFhJLjKBefQjFw/QvdVlH8="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.6","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"5cbbb93f24fe69c973947f6d2f46b5675a75dd92","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.6.tgz","integrity":"sha512-jDPGDUAQH1eTU82JIOViT0NTyWtZhUyr1nS2kIYPVoBq0YfZyuQoCZL4QWFfBrsCc5HsnSPTwi3+nmAGA5Rwhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwQmT40kuyuhylplyn5iiOYDEwjp49lt8aiMIi+wiBbAiEA5pJ4NZ8swaK/aXu6gFioKRxM99LTlAiMWFX+14L9Q2Y="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.7":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.7","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.7","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"014153c5848151eff5063fda445ebe3be27c514c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.7.tgz","integrity":"sha512-3badwVdNgm8HRiewM6GqMUsCMLcH/uz4o0Ndx+Nz9erP2ciKcuiu1x+sRZY8pnQqvTos9NDXxF501uLGIaKH2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEGhtmnNeL8xM/K59MbBg4pI0a4j+koZxEU9IP/6IDFDAiAwhJvl+d7nALppL3EBKJl1rIdysVwQqH0dsevgBCnVFQ=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.8":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.8","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.8","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"7e98b1514eea8b2257100c492082cda878131296","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.8.tgz","integrity":"sha512-qsHnknqseCP7d9GLMbcMOQYf1PQ7n/+X0CvRmCGXjQqUmyhrrmgbRcyjx6jRCru2vr5aw9r0UrsRL9GPQnQ6UQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDASiGbFQVzG83k0ziyd/eonaln+wkUhnSgqU4JMfEgUgIgQmAO+Eo3w71LhiZECIm/6LLQrI/7D5iS+a7+MaCdY2M="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.9":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.9","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.9","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"53345cf7010fdef9aaac65ceaa2f53170595ac89","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.9.tgz","integrity":"sha512-A/8CDi5WAjFUdb6pR+o8Ru2TfZo48YUSBEEgZQZNdYXI3ZOuW9GVXhZmqhIAzBrL7Z80q8q7T8fF/sVOOkrITw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOWVmWBWvoq1N4BT32CHsAcxUqzgULsc+q+w0vlUvywQIgED4kGmwi0FZTHrkt5aC4Wa0UsKKyN6/Dkj8PaHKsiFs="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.10":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.10","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.10","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"37f47046022c14de0795eb6464b1c1cd523b7efd","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.10.tgz","integrity":"sha512-JyCgB74Lfn6JkvtfOuFRC0I5XmECweMJwTnqRpqebi7M3HfGOSfLSAKU2oiMpLvz5/boD7EkelCAWVg/3eAyzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJVBzWLg4hOqnIvuelKNZ7h9AVF9kGgDqedA4QDyGIbAiEA4ObNiFNzui3xa6vsfFCh83Six8MrI5AYJ3YZUJLMQj8="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.11":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.11","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.11","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"f0107099c16199770f09c896e103d8dc93230ebf","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.11.tgz","integrity":"sha512-AX2NLoWndcElEmS3p7CNSA497r6IXU8hRiMVVPymrn6XpYq7IUi3uKvvsfXwvYoP5eWAQNqm44Y0+h/ANtXqPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEL9tESknNFSLnUkPbT5Le9eZ9aqQMQCya1P0qLNNtKjAiAW1+H/iqsfdgDI2henxf9bmiqKpKScdCmWbM2zoDZ5EQ=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.0.12":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.0.12","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.0.12","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"e91634c3d109c34696d97ef8405dcb13ffcccaeb","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.0.12.tgz","integrity":"sha512-Fec/NZ87MAUgoVTedmuGxQGGITDvE7Og2HDDyDkwobvA3hmJ4DHu4L/jW1gLsq2K8iZEqsWIUL5E1wETYHGq5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcqVutwpobgqlblCdCLKkz3r9NfvIWd9GvATspLOIfbwIhAN0ROaU2YG5IaHNZn2+ImmDqdKLJlhA0FOW87IHHWN8h"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"7ff67eb1aa6d06f2d91fca02d87da111bc3d70ad","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.0.tgz","integrity":"sha512-ZPZC9l33TuIFwg4rad5KHfjXQ2b7oA5PIcITXQfWhUoad+/IYJMaHtb/Rnhf2qFexdz+KcTSfQVxuvQRNOvZXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJrw1yspq8aP8rCIGRiMysn8y35ONwD4N9Ql7wv5rHeAiEAiIunOt48r2KS+wWQazX59Md7VdJ0nLLWAPRpGRwUU5k="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"1a91103b0192b4b4f006c76eb2d7678a7764ea84","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.1.tgz","integrity":"sha512-9yo6nWGjNKS9M8JypmqozKjzHidsqR/sxJPbLTEPKYXAYP1T+xZ/GCEeXeEW4kGMHShHBt2y3nYw5uRGE6QZuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0sYzbXAT8nIXM1exy2qfjden3ZknxmsMhC2tQIo+DxAiEA2ni7lKFqe+rpOa1zYJtlQNkRmOgBWi3KpXEgOokTVzE="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"6aa5a0cb0ac73677dc99d8fd66fd3e791b6242d7","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.2.tgz","integrity":"sha512-C7W4nKnGd4Q1yf5IrF9KpzV9T3DxNubhT/x4L+gsqsN7W7UKkSAt1VdcbNPholpQ6EB0atiUgx5jXVe+AGcTZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9+QICcYDDJN1FWsy9Qvxo2+z0YGBzZM+YiayxIZcvlQIgI//r64El5ohtVywrnVnlz2B7Ho9UHJ1rySTLlqOk9rA="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.3","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"3211b9fd0ce9dfdaffb70e343fe1c7293c4537dd","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.3.tgz","integrity":"sha512-5M9uVoO0cjlQboxG/SNhKPVqPNt16DL/1pqjGr+TJxcGaeKyrvmVpOB35jBSHnLUDGwEpWnXnQi5RVkvrU9hBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQy9h12gURtjY6SCyUCfVCJZT//w25ZETIalCG+U4boAIhAL+ATS6JJWsCO9wrfsVLqZN82wJr1fxPFGG1q3QwmDzO"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.4","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"33efaa7aeb329c937206c0bbadb6e1629361b315","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.4.tgz","integrity":"sha512-cfjpAiC0VrnpZXvj26qaObXmaV80ogdZf6XaTO20DglNkDJ5JkQHbtaqhpPugLVX3qx418JfHpbj+iSYwk/S+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFzimXeXc3ZzBqSJQolMxngeUQ689xqGgEYZtiARrsnwIhALEhOiy4J557rIc1DcTnXyVFktzRZkTt99yaFO8n5blv"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.5","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"138c0e56aafb8a02ab22a2826d38537b631edbc3","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.5.tgz","integrity":"sha512-Y7dQj+LM2BbyeoVivgrfdE+njXD0qrcwB9tsjl7Mc4EXd3Y7YtKz9pk6uFUeC5J94hQ45Q1JIOdJEPRQmZH/tw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiuAqdgK8JAfyOxWiVNi6C6VVkFt5vOk4MVYuh5h3jUAIhAJbzbyzTymfrEe3pla/fgLtrayRJFkkk4+yqYU1JFk8U"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.1.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.1.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.1.6","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"b3540ec5df63b8693e8da9e0b9987d5fcc0429f5","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.1.6.tgz","integrity":"sha512-z7CqaulW1Dsv/0HKV+jcglAVZDpZ0UZlpNdOQuW7a5twAyjTuqEAdRPhHFq3gIgos+CcKW7XUiwEEyVUKudvgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM1d6tP11xzm+vnSgOQP4ms0fC13AuKAj0BOUjIrx0iwIgU/ZZ0Ist9hHyxUxXJrE1SJJsL8WwBOmaL7TV9I2VAF8="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.2.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.2.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.2.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"be204b552374f97f042ed255ee13d7e6087712af","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.2.0.tgz","integrity":"sha512-D6W1lLBGTSsn/B9IZidWYhwqJyixFA6StWWzFuGgcjyh4MjyXvd+Xq/Nkh+JfJTkkDUkuOCBUeuAvIdEOqNAow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSRAz2pQwTZre6llH3M1ARsKepZuu1mat9JY5/m6PR4AiEA2YWrP6efLmikH6tsSKbdAAbWg0bHn4aVBx4azfdHUTo="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.2.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.2.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.2.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"acb70b4060056b9bd85b0a9b4c104c4bf2ab16fb","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.2.1.tgz","integrity":"sha512-zU/iN99hnop1NMtqkRsTVAK/m4HT5l96q+O5G7tpKFgwIk3xZijz46ltgoK+1nbzV5niSLcC4RZm4UBCgm25EQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtcwBhqLAIdfGyECaH32m6P/vhL/Rz7hJXAPwjyQizLAIgH5k8Ikn/TuzYU2CVAn886S7KU/lp2g0+n0i83xlcwpw="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.2.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.2.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.2.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"9598f10c8fcfe8f48837a7d547af621bc1a64e79","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.2.2.tgz","integrity":"sha512-1BKo2jPli5f67Ebk54yoYB2AiBn8qQiPbRayfIy6DJAPCE/TJW8pqZzm3US5H7OX2WqHTo0Re50YnmIE6i7KHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDXaPZDKVW8O1seZgTPw3USBFIM+gLjy9yMgCAIy47XpAiBrxb8YtOsDPsW+6TelMHN8ZAMHvUs+UX92lpI1kVI9yA=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.2.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.2.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.2.3","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"d90fae8ec0e94854da17ef259900e2d50caed172","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.2.3.tgz","integrity":"sha512-Wzy7n0evboYRpMA9hsV1u9OIlxnColS+nscbwKQEZqPH+59VbFKmg3NzK1e35qba8owCw+ZKbWt+LELBl5rLAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIER9ciJpvJJ1Qy962aGhw91vCp5Z4aStREbgIjv8Qw1CAiBPX4eOwgCsqUnQaloCTtS2LrqzuLSdYskTUyLMGZ21Xw=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.2.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.2.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.2.4","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"10ed48a9ec458c97d4f37a97d2d6134d96240c05","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.2.4.tgz","integrity":"sha512-K3PBn8BkU8KD8MtB42+Hs9oXqp+SYeYqDdXewteS+BrmP717kW/h1phQIX5pn7Wgs7ol9SZp1gEcx6yO5OAkXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEnb/HJjzSxIo87JXXtqDA6eRFQvPPxVv9FwBU6bO8S8AiAlAxUuAW+Oskes+jDx93pWbe+xvwRBHhI3gIjuBL/EhA=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.3.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.3.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.3.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"8385871e1a1768a6fc5e54e5a6382bd9f35c4590","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.3.0.tgz","integrity":"sha512-1G4nPyaa0kS4A1+Z4uXdkYzg0qNAubTsfYZ1ybY7b25sxIz0MvnEp7vKnTWymYyTQDXp0EgPNwywpxg6gvv7uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIHGX5LhHHsrZRwHP4lWQOLUuOYxMBzIzv3cVrG9OTZAiBu0U0jD/03hcwos9b2SLot4dcBQMcJOcwo77idmOc8AA=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.3.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.3.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.3.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"f6bdbec43198c1593a49aef30d2952fcb64fb31a","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.3.1.tgz","integrity":"sha512-TYoXVioPKeuGSUn4aKKvxyZ5pXlRTzn64pYs9HDIxAycYy1B4DCmGCIIAdrHfJZxIs0Gwrgzf6OxuZR7+WCZnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBO9G/A8RNOg81QXTh8EPUR+xJPzcuq+Ni5iPGMrJ9qAiBjkyVFnu4sKISf6gV9uc9ny9nyUlhxXukWy9t5sH4UPQ=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.3.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.3.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.3.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"2583e28f4385f52746b840e4e31687d923ade38a","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.3.2.tgz","integrity":"sha512-eZMH+tNvKGEfNfV+dlXcdT8tQOnewe9cnWO7GhND6ZPKWvv5J4ESqJ/kLyTOlAMDMCMvNFL/VWiDNXls+U4q1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyQM+rwM3BzS7GLd0go0FtzJT2Mq/shfO14vHp1y2wVwIhALSMCz31euDk2l+DVd61bgqt8vBXpuaxHkAaSys/wSkL"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.4.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"70c1aa1c7696609ccb2e435d5081ccad020e2315","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.0.tgz","integrity":"sha512-pEosHgQfzJ+7grSOEnqAaGlcVyQOv7a5M3MfYPP9piyIbsQOf2quS9CgrCdd4PMHQL+EoE4pZBln33s/kZyE6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCr2pSXDGCtNMfGRrz2QWk5Ya3DXRT2FzrlAS0/D7249AIgSB4hU6TfLMy/cMz3Dx3Xcb5zEa1zP+Cqad9PSFkzFUA="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.4.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"6b61ec64efefa397057d74e156a9de21438103df","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.1.tgz","integrity":"sha512-ddu9NUCY+11h8UBPNfGYiK0MyS+i9gqI0ePx7LxFbf+VNECjHhvBJUfEvsUWt5DOcJHLEcWneSLg3PrRcqy5OQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF05woG1OrFnnkYBaTH70fQwR+43OCU5737Ylk1pyKKwAiEA+4TaTI1pu/fv9LOjsOgZ/RldpAW8oO3dh3V4nuwIppQ="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.4.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"cb59fe2362b33d205fef2d50057b96e07acd8e94","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.2.tgz","integrity":"sha512-1ECQIZzEgbp9bq8xCjADmon3D+gNmmSH0YuaA9M9HrFAiBp1aA1XbUZqCD3WjpeZSNYSV73kqsMYWqvYqzGu0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChPV6Ul7miERa5S0IQA+v/nW/VK6wzJoJf0Sec4ULuZgIhAKR6M5RNmEIcrjS7sXAUfBHBW2BP+dD/V/mRNnwlJK5A"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"_id":"ttapi@1.4.3","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.6.1","_defaultsLoaded":true,"dist":{"shasum":"ef4101b93fe5d65879ed276b47c75b11fb5b4e7a","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.3.tgz","integrity":"sha512-iUQRgh0dhzSJ7zVmvTEZjOMYaNesEXa19xfYgfMKiYdxB+Uc/cXfjINkSqT4ecTwLKEjBDpaWharsW6vKDq+aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICc7hjHUXcWHD1VKjH5H2yaUi0JZIvoYcDmpSYdXdLHtAiAYwnS91HIeWM/Xg7Q0brFgDH59+vDfsqFWIM4RvGGv5Q=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n   // Respond to \"/hello\" command\n   if (data.text.match(/^\\/hello$/)) {\n      bot.speak('Hey! How are you @'+data.name+' ?');\n   }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n#### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator.\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n#### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n#### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n#### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n#### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n#### Warning\n\nThis function will not add the song into the queue.\n\n### pm (msg:string, receiverId:string, [ callback:fn ] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n#### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n#### Arguments\n\n* `query`\n* `callback`\n\n#### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n#### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n#### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n","_id":"ttapi@1.4.4","dist":{"shasum":"ae04794f128ed889afb0e81051e9ffef8ecffa0c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.4.tgz","integrity":"sha512-ge7nW9EbfsO1oznv9yW+HW6qhmpLMVM4USFxySxjvWyfAWtnGcU800l1enASobs4FGzZXnM6VEXYJLFrklKOjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgTBdUCvTAuFtyPWFbndyrsX3c5unxDaMDJUQ5l+c53wIhALAy0Xeoz/aQ0JhRY+8lUKG4ZknGcLN63TWE4aDBUGAJ"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n   // Respond to \"/hello\" command\n   if (data.text.match(/^\\/hello$/)) {\n      bot.speak('Hey! How are you @'+data.name+' ?');\n   }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n#### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator.\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n#### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n#### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n#### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n#### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n#### Warning\n\nThis function will not add the song into the queue.\n\n### pm (msg:string, receiverId:string, [ callback:fn ] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n#### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n#### Arguments\n\n* `query`\n* `callback`\n\n#### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n#### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n#### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n","_id":"ttapi@1.4.5","dist":{"shasum":"898b26bf5b0794c87bdb01e2868bfb4dda615f52","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.5.tgz","integrity":"sha512-y/njZ0aZ8siY0SJwdQa/hj+oXw2ffzaAVVFRBNtt4ZnW7B7104Y61HSzMeoyf/MJ/IVab3msWl46dMcMDief1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmottP/FmCCqHcawafL+82HidS5gCTTuli+fcIbaO9bAiEAsyHa4NNURZG9Aj97BFtuM72UuYXzUaPFKcD8JsLTVRc="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.4.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.4.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n   // Respond to \"/hello\" command\n   if (data.text.match(/^\\/hello$/)) {\n      bot.speak('Hey! How are you @'+data.name+' ?');\n   }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n#### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator.\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n#### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n#### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n#### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n#### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n#### Warning\n\nThis function will not add the song into the queue.\n\n### pm (msg:string, receiverId:string, [ callback:fn ] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n#### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n#### Arguments\n\n* `query`\n* `callback`\n\n#### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n#### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n#### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n","_id":"ttapi@1.4.6","dist":{"shasum":"d2172e1417592c714f67d05b8bbad73eb56b6953","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.4.6.tgz","integrity":"sha512-MFHErP4iAYCU4K1v1hJpC/3fBopWmiW8QWHIgBfMMCpDc7XhXYKDK6T2d7hgQCYA3P4m2MltKp8W1vRqzV60hA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxIgpykK+rfvPNS+FHBIpYKEDtBksOUAu1epvJjIaOHwIhAJ51J81Cke/p4nOp/uojkQNX9S/4rJbiPwwSwtv42jdQ"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.5.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.5.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n   // Respond to \"/hello\" command\n   if (data.text.match(/^\\/hello$/)) {\n      bot.speak('Hey! How are you @'+data.name+' ?');\n   }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n#### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator.\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n#### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n#### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n#### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n#### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n#### Warning\n\nThis function will not add the song into the queue.\n\n### pm (msg:string, receiverId:string, [ callback:fn ] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n#### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n#### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n#### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n#### Arguments\n\n* `query`\n* `callback`\n\n#### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n#### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n#### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n","_id":"ttapi@1.5.0","dist":{"shasum":"07da8f6a709243de7b6f43bc7532ccdff8434861","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.5.0.tgz","integrity":"sha512-YmY8WyrRLI9G6O0YHyiSOpdKInFXmt8OY8Boxc5SLPsozKah9/kq+Ux3sZ/TAbXBUQAsaNl1FVpfUVMyozX0iA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc5GCZjlFB5yZTHIMNdpnd8kwTwE2BB8BFWp2sPSj9oQIhAOElzkZO0dBLRbr+Gv7Kef/Fs6VOjgjCZdnkXLLP54R2"}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.5.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.5.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator.\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","_id":"ttapi@1.5.1","dist":{"shasum":"6ba37758ede10724c0e5432b5d8a34bc5acfe6be","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.5.1.tgz","integrity":"sha512-8/5nNZoEcaw8i13Xtpx6aEO5S5JmfdKhtEXO7iHtGSNEuJmQaSctjfaD8BX/E3TAaSKHYNQEbYVnPfdFpJxg2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQ4xclMwKdjKvnn9YNXbqxekA7s/7a2tqR7GEJ2WhNEAiBO4oaW8cm7jTAbGptu+LfoWDwSlsW9/7PdRDL8uBxn6A=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.5.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.5.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","_id":"ttapi@1.5.2","dist":{"shasum":"381915c9236bdbc8db0f24ae703babf0bec25a7c","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.5.2.tgz","integrity":"sha512-S9bOe84oVak8Ag5W7pWXeXSBDO63u/4IEBuz/R8Hq90B00knQx++XHZPmm2cifke+9T2Tae1fv7HPaVTL8oNDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5UdpPgjRJKy0Q3IENrr09ckSg/Lykd5SR5RvCNTGZ4wIgV9wRIiRT0d4OialmFXUZFPZ0hegj3PWJlo2gJydRklg="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.5.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.5.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","_id":"ttapi@1.5.3","dist":{"shasum":"99fc23fa387f737ee66fb6764ab1a47377d6d527","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.5.3.tgz","integrity":"sha512-7Ds4E2C/KDkQkPBrPo0A8Ykxdwp+ujcz3+ILVQ1616LdusAw9VSSkBCGTdKa+IbeyfWcpZFfDwk0o5YD32ilug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVtBOkK3RMttYDygsreHfROnwVsTB0rNh+O9FDkXo0VAiEA7dBE7Zf+B27TzKAeFrmza6IDWTG3iSFzb+FH+8iZzLk="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"1.5.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"1.5.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","_id":"ttapi@1.5.4","dist":{"shasum":"6e9a25674e3a4ec5aed533834f597018b88453d3","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-1.5.4.tgz","integrity":"sha512-N2sJr3q5H8HiX0j0cuUrwSvk8agMu07eMBBOrkfRNWWYskW4LKsKNiVuG8m5H5Tt1T3y2qljMxy0iStAu8q4dQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwDiGWEE2VJ7JKP3ewcJLWMyU+CtZxofUCP3MG7WuwCAiBqZHqIzC9i4ib6BmEC17TukwEU/mAIpG7Zno+KJUmiVA=="}]},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.0.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.0.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.0.0","dist":{"shasum":"833385dd23e88c1e5e20c796acb88430bbf7e2e5","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.0.0.tgz","integrity":"sha512-6BBq1+JLKBP4+E7cEfg6wv0o4miXs4dBfwPIXtm8bGO6vgKVoxK08g87hXY2eUBBFYG84AaVEv87LFQQNYWjiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqpr8TKfpvst2yBveWlQsA3FPtlAJgb/bhF6ygpA5yuwIgX+19H4cYKfy6zhhp25CZqr7GY5MDaietSxodTnMUcWA="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.0.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.0.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'auth+live+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://no.de/](https://no.de/) : Free (250mb memory/500mb storage) hosting for nodejs projects with SSH root access.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Free (scalable memory/storage not to be abused) hosting for nodejs projects.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (1.5gb memory/3gb storage) PaaS service that supports nodejs.\n\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.0.1","dist":{"shasum":"ea22ef9010d59b0e2119bcca22291014162c85c6","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.0.1.tgz","integrity":"sha512-Mt+f7+Ck40R8KtT+9fs5DRLbw0DcHnADd9dZuGDCHrIIQJ+XGe/ECTuwY/vuJB/SW5MHURZ3DZzzN6kKntMe+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUjZpDCUyhPevRziIXuVh1rBhBNSbzcbJpasZX6UI6gAiEA2ZBuRdTLHbwEy4OsELf96q2zV/HfWbS+QFHFUb44k48="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.0","dist":{"shasum":"4e16bd784bf50b6b4c7fc784bf51efbcbb8fe631","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.0.tgz","integrity":"sha512-/bbRXEsmogW7wXNOCk+4ET26bY69PMVVlsH2NM0tcwTst82Ntsrs7UvaqAVXX/wbWz4emYtRWYG8GscmE2ocOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmRC6648upkqX9v7uT/K8LPzTWmF0ucWp5uss8jk+aSAiBp5yBcKIlOgYfX4vUPOKi8l6y9k1Sjp53hX21ZTnTt6g=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.1","dist":{"shasum":"e860e58c95ee27c7c432daffac36c2431a252ae2","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.1.tgz","integrity":"sha512-Y14iebRfnmiXp4thIUzkhRP09dVg5MJY11BSVY2AdZt3CB1mdr0hyt9HARfniwkeYLByjgmKAIqfXZ848ETTSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIDo2z0dQ4XoUlN1oHTuC93p2nlj8pgdtQ7rc6ErYvpwIgZtto4yoQn0H5jWLqUCFuOMgVdAkgCQ2Dp3H/nV7GHXk="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.2","dist":{"shasum":"67335fedbbf87e8e6e40765b73a50840285d9763","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.2.tgz","integrity":"sha512-nHoHC3C98CfuBvGbmuNEn60iCSknJ31sZcE8sGcOY/bhLstFVwAc2evMB/Lwckc+WsLWODGU5egVx2uwV03b+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDROKFblqq/66l10FFx7aDRBvUcjg7mkGm4D9vIKX7N9AIgLqOwGsp4u6zvPtRnpnNtZAPazYNT4zMvnQVID4s8UxM="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.3":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.3","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.3","dist":{"shasum":"7692dde3d336cad2b2b03493b1a9212b1d4cb853","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.3.tgz","integrity":"sha512-9izqbA5gLfhlyyNyOHbRqofQ8SCZL/vjmUS9ZHVhmaoiSqddrXUKFxrlD+eVJ7jWVp4a8LDhjVKqrmaUrg2BkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2M9zLIos24CYNj5fXGVMEZPR69KIX2KkUbLskcKrzVAiEA/Lz+ctzbK1S9frssJQ1OJEE3jyeuOBQkyLShbg13E7A="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.4":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.4","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.4","dist":{"shasum":"b1d71feb2d5b939ba0811445a153d11bb353a0d9","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.4.tgz","integrity":"sha512-buAoyXMXzp+i3AlAXDU9ebPI5msbg5cSOT+gOF/xpUchKXd6ffErX2MHsJl66TaEdZBbVZvZIWQ4V5s8zvFofQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIclDhv4yEGSMG4K/l2w3TT9XbL/PGmWsJsLDDdKMtvAiEAtm2o2fyv8Xhhrtw40vy5YqyfC3DjuLpJBONU/r8/qeU="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.5":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.5","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\nIf you are having problems with npm (like with Windows nodejs or portable versions), just clone the repo and edit the templates in the 'examples' folder!\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.5","dist":{"shasum":"c086df3e7049b86e1813f173c33d3a5529bc04e7","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.5.tgz","integrity":"sha512-9ova1h5VSq84xkfgc3AsUCvU83hKduQDkCm6XsWoFvBRO1z1b9BM0T2FAW08CnZRDX2cf5bZhax94eDQHQv65g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnBY1ElvBhiFeCAgu5d6F1hGzsvs42kiy0+TGE3JKgZAiBvlPjSiLs6/XoFj2HTIW6nZJxtTUgzXp3P3FZCilwO1g=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.6":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.6","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.6","dist":{"shasum":"22f07f08e0d5a25cc0e468abcff9e38211d531c4","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.6.tgz","integrity":"sha512-2ThprERQVXXk6DtwN/19SJAwp05pWsqLy7/d/G0CGZy79x+d++dWWK/TOVCELmt6M/SkxLexPfSNu2b2NmQYkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0UDOK5ug4cgoKRk2UI68kmXdttubNQT5vs7XTwt7NgAiBYktM+30UARmGB4wHKeTvjeLStfXxHEQ8W2Awgovnd8w=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.7":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.7","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.7","dist":{"shasum":"6415a89847e20a5c739caf62eca2f8a4c8face88","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.7.tgz","integrity":"sha512-H/eUd2Ar1xjqaEK8u2V7oyd4E2nxYgRB9fwFM9uMWIpLLNwXu7P5b9IW36Ll2JqiKTMSpx9I4uZ2gHhiG1ovMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFw/yvR5YC05YNdPCEJjpbMzIxDLlp1qBR+iv11oIm1MAiEAz8YDvlE5hRyU5OhwRE3KDfdYMG+nqbohYraSvVN/iro="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.8":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.8","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.8","dist":{"shasum":"0d29792c2f7d5fd1624609abb4b125a0ac95ee15","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.8.tgz","integrity":"sha512-6LjfxoAr36ZxP2JDd0L2PBwj5Vp95YRXlm/IQ0Ga0k1WBP94JA/exJ9IR33DkLf5QC2jjxwjZ1J2eNH5IAmzYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3fKGG8lmynDow6Rq0P9Cdv59lj7J3h+ILMbkc7RF2LAiEArLXgh9x8RTc1o+E8vKas6vEWK1G083an7/c2XDsF48s="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.9":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.9","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.9","dist":{"shasum":"3e8788b40a7b2f1c89475eb8817e338a0dc81b93","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.9.tgz","integrity":"sha512-YDXVUxwkRt0ujzAoHUTE3oXKxNefNoNSTgW0Qo3J6zOfnBcph/sm7JvhbBTaMdTTd0Yd4VlRxKfUb5jdblJXiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPONVb1makJW/SClRKSYbbis7fCWg8wn5kVPydAJz1YAiEA4GgGKw4PBfK2AzfgqcOmHPEdZ6kfY7eLoTijMXaynbo="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.1.10":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.1.10","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.1.10","dist":{"shasum":"357b5bc9cfe8916fd43f0e07d71c5e1210e3b369","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.1.10.tgz","integrity":"sha512-X8LxwMpUgZtEvnZr2enmIeNGY5EN+wwtI4ZTt8rOgnT2W5nqdAIdeHBbFU8IYP/TTpuUMnM4iyqvQ6J9+2i9Yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBKQX9KExPVlYNX063G6hwaE/KJHJA+wPZUeBk/ziutAIhAO6xOcpugk+E7nafCgje7I8ErfM+V5EsRtcSsGokAugq"}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.2.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.2.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.2.0","dist":{"shasum":"02f0967bb33a4edb89f0eca317baa565f155b3cb","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.2.0.tgz","integrity":"sha512-IdPNHOAB8BW+XcuOfo5+GAXop7EwxzpD9wq/UEGBe9TlHr5Efo+rzCkTn6diMab510Povgbm62+VEyCjuLSX8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpHoUhbyVTrpn1/TYrs+VZEcx2ZPw3Zv7qUgTKinUumQIhANtEHNZJUiPlAx/g+ySIxm3PZ78kyIpk2VkJ0PjxaxiT"}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.3.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.3.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.3.0","dist":{"shasum":"f10c5c0af3e3e421b93c86ea2273a9529b05dbe0","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.3.0.tgz","integrity":"sha512-YsWhyruM6oDbxITADmqilU+bw8nDlu073vhi8/rjovXLyo4G1AfFeUN96QPDKtW6hBv7BPx5TuuXEgV2wq2yPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqAcEDMgzJ4bse1qYffyuqxQX9i4MboJoC51fzqjGzAwIhAJ0zjE2YB6KpK25VOkJlW6KY4lszGqkgIeLgc6L4tSgi"}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.3.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.3.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.3.1","dist":{"shasum":"e6874a6cdb558a243568b1e434f1797badc92863","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.3.1.tgz","integrity":"sha512-C2KGVr2Rnf6GayTM1Q1aJN4JwtplrXjNYJSQ6RcN6DwRPwyq9YQKui3fJv7Oxm0JjPLFeOTwiBnYzxgkFzBgMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFjZeuFxY64DDK66hwDMu8TMD0Jff2ypnqRPiHovnYxkAiEA9l8keREaIwqo4BWrMDWLoEvIjMNDMyN08EdQO4cyJGI="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.3.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.3.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.2"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.3.2","dist":{"shasum":"9a0adedc4744b43d859dbbeac991f8fb821dfa8d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.3.2.tgz","integrity":"sha512-XPo1two7XG001RkC3KUuDyRPW+GSCsLyB/+RAVo3p4Vv6xHF+qxTISEj6A1Dydtmk9/bcn4zsGh8I4efkE/7mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZdw9erTeQfrgOkL91IIHBATKt5bzYe8cMoslpEdBOZQIgUoF74f9COm0bPXvaMHRT03tJMzBpm16gew40b1edgms="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.4.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.4.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.2"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.4.0","dist":{"shasum":"c47f8834cc83521317af6a661af78d267fa23b56","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.4.0.tgz","integrity":"sha512-wMc5gRalZXiqmt7v5/g/ejWKud/oMwNvrWDG6js3pikNo7yHPrj8UsLX3mSPx5Qvzko8B/m2lYkMd/BwuPHQdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/ETzgWq8C6YQYkfeIfSOnH7hnzZ/zhzasHygP3AcRGAiEA6lkPnCqQpkPhC6kvP8A4c3BRnXZ6cJ8svmfNrkyA2dY="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.4.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.4.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.2"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a tcp message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an http request.\n\n### on('roomChanged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is shown only if the user vote up, or changed his mind and then vote down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses his moderator title.\n\n### on('snagged', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a tcp server.\n\n### listen ( port, address )\n\nStart an http server.\n\n### roomNow ( [callback:fn] )\n\nGet the turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformations=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformations` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make the bot become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a Dj.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove a Dj.\n\n### stopSong ( [callback:fn] )\n\nSkip the current song.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that the bot can currently use.\n\n### getFanOf ( callback:fn )\n\nGet the list of who you've become a fan of.\n\n### getFans ( callback:fn )\n\nReturns an array of everyone who is a fan of yours.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by his name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[profileId:string, ]callback:fn] )\n\nGet a user's profile.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nSnag the song.\n\n###### Warning\n\nThis function will not add the song into the queue, only trigger the heart animation. Use this with a callback to `.playlistAdd`, or the latter method alone to queue a song;\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers informations.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets a users stickers.  The placements object is formatted the same as the placements object retrieved \nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.4.1","dist":{"shasum":"2402f897b3d164a12a492e9cef6aa2778a4b45c6","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.4.1.tgz","integrity":"sha512-WHxPMrfKPBjos97EGuepUttzyKFQ0p6T316ru24GGOrwOe2qqqdgrbOUNEpemOm29jbpGmljvaw/w4MuBNVIQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLotRGrD/KPl3U2r+rUii16D9xtSSG6gebqYgUglFd4AiEArlRFY3Ixw6X73ZPhhoUyPPwXM4Mh6kU4t5wjVaqyfbY="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"2.4.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"2.4.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@2.4.2","dist":{"shasum":"afb13d16a67b481652447df43979f84eb3de7092","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-2.4.2.tgz","integrity":"sha512-bf6Ptxd3YjVCxFmFp8f6sWQJWvxFXvLCs/iloOEvg9aP+dFIrnCMdg6fljOPUvpxhIX9ALJoprDqdkYf6l/Kfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQ0g+moNV8J0HyJd2xez8hsKLo7frzYgxAC2xE6EPIwAiEAq463plECPxA0p3KisKfABKEivI0mf6195PI7pnxRjzI="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"3.0.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"3.0.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('error', function (error:Error) { })\n\nTriggered when attempting to connect using an invalid roomid.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when this error occurs.\n\n### on('disconnected', function (error:Error) { })\n\nTriggered on recoverable connection errors.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when the connection to Turntable is lost.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@3.0.0","dist":{"shasum":"17f50244ecf853e6bf467f5030d02a05a9c600d6","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-3.0.0.tgz","integrity":"sha512-Fb6n/ymmvnkXyaJX5BVXLmoD+oJvJhazjv2nVoJCG9cNbFxVOF1dzI8ntFJA7TlKQYLRpchbo/aG43Ug+FEsAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCckblD108OsUqPRLg4JBkujLvJKNP3ogFtSWFID1rCqgIgJscWD/OjNbvKpgfofky/CpoQYf5AtMOPm7olrEadWH4="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"3.0.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"3.0.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('error', function (error:Error) { })\n\nTriggered when attempting to connect using an invalid roomid.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when this error occurs.\n\n### on('disconnected', function (error:Error) { })\n\nTriggered on recoverable connection errors.\n\n###### Note\n\nIf you do not handle this event, an ``error`` event will be triggered when the connection to Turntable is lost.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@3.0.1","dist":{"shasum":"0236139be37f8bbc014963ca43ddbaf733de2e3f","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-3.0.1.tgz","integrity":"sha512-ss25JN2uvc5ZeFfMDi2EgdocTQ6hS6i05FZci5g/y/MWCfIERupq6+CUD9feI14OS0tmhnrNKsGUhJJYBqxrzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkAOJUjSIy+b8HUDOPGeJ++qZTHU5X0BxLJ5CmZ04s/AiAxHHVw9DP15jE+44jQOMDdHcwvaKR/I8hJqZ6Im+SkPw=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"3.1.0":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"3.1.0","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('error', function (error:Error) { })\n\nTriggered when attempting to connect using an invalid roomid.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when this error occurs.\n\n### on('disconnected', function (error:Error) { })\n\nTriggered on recoverable connection errors.\n\n###### Note\n\nIf you do not handle this event, an ``error`` event will be triggered when the connection to Turntable is lost.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getPresence ( [[userId:string, ]callback:fn] )\n\nGet presence for the specified user, or your presence if a userid is not specified.\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@3.1.0","dist":{"shasum":"9f1f832c0b2eea509671150d74c79d7cddc544b7","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-3.1.0.tgz","integrity":"sha512-qEDVHd4VnE7DoWpLjxzygZgXF8+uDcKU7AP5Bnumo1fr1jgBaoxRwlFE6soEj7c4xz8M+OW2JzKSxGLEkbFq0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKJhWBWTjOSBwcKWKJooeGodxXeLV0CB67yMH3TSSHRQIgdqXJrNgUR/l2oK+/ErMFqR5oxb7ENR2LPtenBAkl/m4="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"3.1.1":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"3.1.1","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('error', function (error:Error) { })\n\nTriggered when attempting to connect using an invalid roomid.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when this error occurs.\n\n### on('disconnected', function (error:Error) { })\n\nTriggered on recoverable connection errors.\n\n###### Note\n\nIf you do not handle this event, an ``error`` event will be triggered when the connection to Turntable is lost.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getPresence ( [[userId:string, ]callback:fn] )\n\nGet presence for the specified user, or your presence if a userid is not specified.\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@3.1.1","dist":{"shasum":"dee2ba0e228193d6451951a8dcb188afe379128e","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-3.1.1.tgz","integrity":"sha512-J3pd6E4yvu0vjJdzr4nB5jPLBAxQrnFiY0ZeUkQV/jCDmtzurzOS5U19NxnISTmHiOeJ/bMBcEWXROcgTJYHow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjILMjV1sVcmFbiv5G30EleSYGV4/l02nBZaLpeH/T4AiAoS+gIdLCfDB5SMocyITmMHBjJroO0+R56VZ+LnwoPTQ=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"3.1.2":{"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"name":"ttapi","description":"A turntable.fm API","keywords":["turntable.fm","turntable","stickybits","realtime"],"version":"3.1.2","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"main":"lib/index.js","scripts":{"start":"./examples/chat_bot.js"},"engines":{"node":">= v0.4.0"},"dependencies":{},"devDependencies":{"coffee-script":"~1.6.3"},"readme":"#Turntable API\n\nA simple nodejs wrapper for the turntable API.\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\n\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\n\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\n\n## Installation\n    npm install ttapi\n\n## Examples\n\n### Chat bot\n\nThis bot responds to anybody who writes \"/hello\" in the chat.\n\n```js\nvar Bot = require('ttapi');\nvar bot = new Bot(AUTH, USERID, ROOMID);\n\nbot.on('speak', function (data) {\n  // Respond to \"/hello\" command\n  if (data.text.match(/^\\/hello$/)) {\n    bot.speak('Hey! How are you @'+data.name+' ?');\n  }\n});\n```\n\n### Logger\n\nThis bot logs the room activity in the console.\n\n```js\nvar Bot    = require('ttapi');\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\n\nvar bot = new Bot(AUTH, USERID);\n\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\n\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\n```\n\n### Dynamic bot\n\n[REPL](http://nodejs.org/docs/v0.6.0/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\n\n```js\nvar Bot  = require('ttapi')\n  , repl = require('repl');\n\nvar bot = new Bot(AUTH, USERID, ROOMID);\nrepl.start('> ').context.bot = bot;\n\n// ...\n```\n\n# Debugging\n\n```js\nbot.debug = true;\n```\n\nThat will print on the terminal all the data that you get and all the data that you send.\n\n# Hosting\n\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\n\n# Documentation\n\n\n## Events\n\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\n\n### on('ready', function ( ) { })\n\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\n\n### on('error', function (error:Error) { })\n\nTriggered when attempting to connect using an invalid roomid.\n\n##### Warning\n\nIf you do not handle this event, your bot will stop running when this error occurs.\n\n### on('disconnected', function (error:Error) { })\n\nTriggered on recoverable connection errors.\n\n###### Note\n\nIf you do not handle this event, an ``error`` event will be triggered when the connection to Turntable is lost.\n\n### on('tcpConnect', function (socket) { })\n\nTriggered when a socket opens a connection.\n\n### on('tcpMessage', function (socket, msg) { })\n\nTriggered when the bot receives a TCP message.\n\n### on('tcpEnd', function (socket) { })\n\nTriggered when a socket closes its connection.\n\n### on('httpRequest', function (request, response) { })\n\nTriggered when the bot receives an HTTP request.\n\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\n\nTriggered when the bot enters a room.\n\n### on('registered', function ([data](turntable_data/registered.js)) { })\n\nTriggered when a user enters the room.\n\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\n\nTriggered when a user leaves the room.\n\n### on('speak', function ([data](turntable_data/speak.js)) { })\n\nTriggered when a new message is sent via the chat.\n\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\n\nTriggered at the end of the song. (Just before the newsong/nosong event)\n\nThe data returned by this event contains information about the song that has just ended.\n\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\n\nTriggered when a new song starts.\n\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\n\nTriggered when there is no song.\n\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\n\nTriggered when a user votes.\n\n###### Note\n\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\n\n### on('booted_user', function (data) { })\n\nTriggered when a user gets booted.\n\n### on('update_user', function (data) { })\n\nTriggered when a user updates their name/profile.\n\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\n\nTriggered when a user takes a dj spot.\n\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\n\nTriggered when a user leaves a dj spot.\n\n### on('escort', function ([data](turntable_data/escort.js)) { })\n\nTriggered when a user is escorted off the stage.\n\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\n\nTriggered when a user is promoted to a moderator.\n\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\n\nTriggered when a user loses their moderator title.\n\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\n\nTriggered when a user queues the currently playing song.\n\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\n\nTriggered when the bot receives a private message.\n\n\n## Actions\n\n### tcpListen ( port, address )\n\nStart a TCP server.\n\n### listen ( port, address )\n\nStart an HTTP server.\n\n### roomNow ( [callback:fn] )\n\nGet the Turntable server time.\n\n### listRooms ( skip=0:int [, callback:fn] )\n\nGet 20 rooms.\n\n### searchRooms( [options:obj, ]callback:fn )\n\nSearch the directory for rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `query` - Filter based on this search term\n\n### directoryGraph ( callback:fn )\n\nGet the location of your friends/idols.\n\n### directoryRooms( options:obj, callback:fn )\n\nGet a directory of rooms.\n\n##### options\n\n* `limit` - The number of rooms to return\n* `section_aware`\n* `sort` - What to sort by,\n* `skip` - The number of rooms to skip\n\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\n\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\n\n###### Warning\n\nThis function will make you become a fan of the user.\n\n### getFavorites ( callback:fn )\n\nGet your favorite rooms.\n\n### addFavorite ( roomId:string [, callback:fn ] )\n\nAdd a room to your favorite rooms.\n\n### remFavorite ( roomId:string [, callback:fn ] )\n\nRemove a room from your favorite rooms.\n\n### roomRegister ( roomId:string [, callback:fn] )\n\nRegister in a room.\n\n### roomDeregister ( [callback:fn] )\n\nDeregister from the current room.\n\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\n\nGet the current room information. Do not include song log if 'extended' is false.\n\n### speak ( msg:string [, callback:fn] )\n\nBroadcast a message in the chat.\n\n### bootUser ( userId:string, reason:string [, callback:fn] )\n\nBoot a user.\n\n### boot ( userId:string, reason:string [, callback:fn] )\n\nAlias of `bootUser()`.\n\n### addModerator ( userId:string [, callback:fn] )\n\nAdd a moderator.\n\n### remModerator ( userId:string [, callback:fn] )\n\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\n\n### addDj ( [callback:fn] )\n\nAdd yourself as a DJ.\n\n### remDj ( [[userId:string, ]callback:fn] )\n\nRemove the specified DJ, or yourself if not specified.\n\n### stopSong ( [callback:fn] )\n\nStop the song you are currently playing.\n\n###### Note\n\nThis cannot affect other DJs.\n\n### skip ( [callback:fn] )\n\nAlias of `stopSong()`.\n\n### vote ( val:enum('up', 'down') [, callback:fn] )\n\nVote for the current song.\n\n### bop ( )\n\nAlias of `vote('up')`.\n\n### userAuthenticate ( [callback:fn] )\n\nAuthenticate the user.\n\n### userInfo ( [callback:fn] )\n\nGet the current user's information.\n\n### userAvailableAvatars ( callback:fn )\n\nGet all available avatars.\n\n### getAvatarIds ( callback:fn )\n\nGet the avatar ids that you can currently use.\n\n### getFanOf ( [[userId:string, ]callback:fn )\n\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\n\n### getFans ( [[userId:string, ]callback:fn )\n\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\n\n##### example\n\n```js\nbot.getFans(function (data) { console.log(data); });\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\n```\n\n### getUserId ( name:string, callback:fn )\n\nGet a user's id by their name.\n\n##### Example\n\n```js\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\n\n```\n\n### getPresence ( [[userId:string, ]callback:fn] )\n\nGet presence for the specified user, or your presence if a userid is not specified.\n\n### getProfile ( [[userId:string, ]callback:fn] )\n\nGet the profile for the specified user, or your profile if a userid is not specified.\n\n### modifyProfile ( profile:obj [, callback:fn] )\n\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\n\n##### Arguments\n\n* `profile`:obj (required)\n  * `name`:string (optional)\n  * `twitter`:string (optional)\n  * `soundcloud`:string (optional)\n  * `facebook`:string (optional)\n  * `website`:string (optional)\n  * `about`:string (optional)\n  * `topartists`:string (optional)\n  * `hangout`:string (optional)\n* `callback`:fn (optional)\n\n##### Examples\n\n```js\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\n```\n\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\n\nModify your laptop.\n\n### modifyName ( name:string [, callback:fn] )\n\nModify your name.\n\n### setAvatar ( avatarId:int [, callback:fn] )\n\nSet your avatar.\n\n### becomeFan ( userId:string [, callback:fn] )\n\nFan someone.\n\n### removeFan ( userId:string [, callback:fn] )\n\nUnfan someone.\n\n### snag ( [ callback:fn ] )\n\nTrigger the heart animation used to show that you've snagged the currently playing song.\n\n###### Warning\n\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\n\n### pm (msg:string, receiverId:string [, callback:fn] )\n\nSend a private message.\n\n### pmHistory ( receiverId:string, callback:fn )\n\nGet the private conversation history.\n\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\n\nSet your current status.\n\n### playlistListAll ( callback:fn )\n\nList all your playlists.\n\n### playlistCreate ( playlistName:string [ , callback:fn ] )\n\nCreate a new playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistCreate(newPlaylistName)\nbot.playlistCreate(newPlaylistName, callback)\n```\n\n### playlistDelete ( playlistName:string [ , callback:fn ] )\n\nDelete a playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistDelete(playlistName)\nbot.playlistDelete(paylistName, callback)\n```\n\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\n\nRename a playlist.\n\n##### Arguments\n\n* `oldPlaylistName` (required)\n* `newPlaylistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistRename(oldPlaylistName, newPlaylistName)\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\n```\n\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\n\nSwitch to another playlist.\n\n##### Arguments\n\n* `playlistName` (required)\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistSwitch(playlistName)\nbot.playlistSwitch(playlistName, callback)\n```\n\n### playlistAll ( [ playlistName:string, ] callback:fn )\n\nGet all information about a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `callback` (required)\n\n##### Examples\n\n```js\nbot.playlistAll(callback);\nbot.playlistAll(playlistName, callback);\n```\n\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\n\nAdd a song to a playlist.\n\n#### Arguments\n\n* `playlistName` (optional) default: `default`\n* `songId` (required)\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistAdd(songId);\nbot.playlistAdd(songId, idx);\nbot.playlistAdd(songId, callback);\nbot.playlistAdd(songId, idx, callback);\nbot.playlistAdd(playlistName, songId, idx);\nbot.playlistAdd(playlistName, songId, callback);\nbot.playlistAdd(playlistName, songId, idx, callback);\nbot.playlistAdd(false, songId, callback); // Backward compatibility\nbot.playlistAdd(false, songId);           // Backward compatibility\n````\n\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\n\nRemove a song on a playlist.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `index` (optional) default: `0`\n* `callback` (optional)\n\n##### Examples\n```js\nbot.playlistRemove();\nbot.playlistRemove(index);\nbot.playlistRemove(index, callback);\nbot.playlistRemove(playlistName, index);\nbot.playlistRemove(playlistName, index, callback);\n```\n\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\n\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\n\n##### Arguments\n\n* `playlistName` (optional) default: `default`\n* `indexFrom` (required) default: `0`\n* `indexTo` (required) default: `0`\n* `callback` (optional)\n\n##### Examples\n\n```js\nbot.playlistReorder(indexFrom, indexTo);\nbot.playlistReorder(indexFrom, indexTo, callback);\nbot.playlistReorder(playlistName, indexFrom, indexTo);\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\n```\n\n### searchSong ( query:string, callback:fn )\n\nSearch for songs.\n\n##### Arguments\n\n* `query`\n* `callback`\n\n##### Examples\n\n```js\nbot.searchSong(query, callback);\n```\n\n### getStickers ( callback:fn )\n\nGet all stickers information.\n\n##### Example\n\n```js\nbot.getStickers(function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\n```\n\n### getStickerPlacements ( userid:string, callback:fn )\n\nGet the information about a user's stickers.\n\n##### Example\n\n```js\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\n```\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\n\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\nin the getStickerPlacements callback.\n\n##### Example\n\n```js\nvar placements = [{\n  top: 126,\n  angle: -23.325931577,\n  sticker_id: '4f86fe84e77989117e000008',\n  left: 78\n}];\nbot.placeStickers(placements);\n```\n","readmeFilename":"README.md","_id":"ttapi@3.1.2","dist":{"shasum":"e17f7eaa10ef61d8c23885c626668b74d25e0d5d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-3.1.2.tgz","integrity":"sha512-wjrfcLZFa3HMVahhVkM5kh+v5bdBzfX4UgvLfgXrpidkvA9/7j39hz0EzkzZ1wmNFrYnOWAJS9LjhK4HBxmeow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkyJJWsPC76aouR3FLumDgax34jgEocbt2tvI6L4Ly0AIgcHzvbty73n9GA6l+X/ha5M2YBR4oyfU1syN772aVfq0="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"directories":{}},"4.0.0":{"name":"ttapi","description":"A turntable.fm API","version":"4.0.0","author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"dependencies":{"node-fetch":"^2.6.1","ws":"^7.4.3"},"devDependencies":{"dotenv":"^8.2.0"},"engines":{"node":">= 14"},"exports":{".":{"import":"./wrapper.mjs","default":"./src/index.js"}},"keywords":["realtime","stickybits","turntable","turntable.fm"],"main":"./src/index.js","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"scripts":{"start":"node --require dotenv/config ./examples/chat_bot.mjs"},"gitHead":"9c6a5fc6688c5c5c1cafddc865c6d4af79cc8d64","bugs":{"url":"https://github.com/alaingilbert/Turntable-API/issues"},"homepage":"https://github.com/alaingilbert/Turntable-API#readme","_id":"ttapi@4.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"dist":{"integrity":"sha512-/2hXhY7mS5su8BSoYB9QDNY7V4ph10oHmcAXSs6lAUtjoN/Ac3ahHHDy8w+ihzIJsxzhc8FWMp4KBhIYm0O+WA==","shasum":"4fbbca0a81ff5590705a0f5f5afe37fec34738b8","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-4.0.0.tgz","fileCount":6,"unpackedSize":50802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQuySCRA9TVsSAnZWagAAu80P/RQYeEmeE60MFXzkh93+\nXllc5K+MBOQquwf9RmOu8hw3RS3KCF40rJa09QO4nPa4lha4n9JWc+mzV+T3\nV8HDc0SdWr6FowE9cy2khldLPMlZufKig8cn01TId9eNuqwNKKny9YksvhKW\nrZZy75llKnvrqtRn5BubgXAmOvyu2Ie+BQtIOqD7Yxy6Il/EkWJR3gUjJBgK\nil0+atB5NngYDFi76u0tv/iRNripXg43lDqGPvtcwh8DFy/rOJy7RxW3jV1H\n4SwfuzzwLp6Qy0Rsw00G4A3nL9+ILkExDFhB9InDOicpaPrahjNH9kRT52gP\nIipbzICK3WAYMuPHg4VwsYScGN8RXcdzEebsePTwOjsPlpFu4uN1gMyr0e0l\nuvIWrqOCgNDB3m/Qt+N60eZh1HSnyWqbi/rig9HEF/TR0lfzn6LTeDrkxMI1\nEY6xgB2gf9jz9qfl0zZPTH1Cbiv1ACdJG0segYTY/8VcBgFdubByh49sOk8t\njLzEKZLvK+hBZvzL1Bh3xobMgwqgAbjDNBr8pOaIMjMqLPF6wREkOb4StPrh\nBw9YRvW6R8EOmk38zrq3sTiCKh4lU1LgQgkNb2J2lQnYyiQCXgJ4s7cbp1oy\n3o1eDcaCoSkFHRd5HYwYHYEQYMIJJ+gVl8sTSo3buxiSomx3VjzsoQc8s3LB\n1ckW\r\n=jmDd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0oh2aFFsUtXlEppewDuLD2P74uVdo8g0n3D0giZcOlAiBbyR2bhnen+J6/WCl4nuTMrETQ0vHsn3dNdAjYf1YO4w=="}]},"directories":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttapi_4.0.0_1614998673803_0.11154584529846434"},"_hasShrinkwrap":false},"4.0.1":{"name":"ttapi","description":"A turntable.fm API","version":"4.0.1","author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"dependencies":{"node-fetch":"^2.6.1","ws":"^7.4.3"},"devDependencies":{"dotenv":"^8.2.0"},"engines":{"node":">= 12"},"exports":{".":{"import":"./wrapper.mjs","default":"./src/index.js"}},"keywords":["realtime","stickybits","turntable","turntable.fm"],"main":"./src/index.js","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"scripts":{"start":"node --require dotenv/config ./examples/chat_bot.mjs"},"gitHead":"c80e9a8655503f6965ac0602692782e1661a01ba","bugs":{"url":"https://github.com/alaingilbert/Turntable-API/issues"},"homepage":"https://github.com/alaingilbert/Turntable-API#readme","_id":"ttapi@4.0.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"dist":{"integrity":"sha512-ba4ybMhc9Mm7iX5U/i98wx2VL9jXck1ejhcCaVGZ3iul7AidU04nCvT8grne9wH3jUZoeu7Na0cA+1yo+wiP7g==","shasum":"0d395e19fcef04946a5b1a0ffe6ccefe02733b2e","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-4.0.1.tgz","fileCount":6,"unpackedSize":50802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQzRaCRA9TVsSAnZWagAAfbkP/AqX0zF0heSKcmVoGNLM\nif5fCjxC3/mJLgnBSpXKHxRiEVsR4yTicQo93KRsa/nRWfG1IjSIV7IZd3JQ\n7MOY1d4/ETRYBmvtQ4y873mOVwtO8VGrN48+HZeZffaGAH4Pqo4LSzZtfT/T\nfCSD+UAb2tqmHf/jHBCXg+ocGJ7p2yd4SlfPqCqE4AI6g/hCXXaBNI1Ehnve\ntwshg2W40r1ikr9ak7GaEd5wOTEmhaEOTkX8HG+qqydK2MNXGn9FGNVXZwKT\nV5/kRpm+c9OYaPAkp/ZRypQ1XsA5F4xA14RGbn9J5NAfWLt1t8OktIba33+o\nJnrpf9cOwj+sPglwkKI7PDpz2dijzGZDapwQ8CJx728iR2rfulKL8T26DGV5\ncSu5S6zhUelRfrt7HBM1aIGpDs3gLp//U4e4fwyKb/uGYblKlVuZYubY3Djh\ntfRBw52foBuYIfIQp6/ZJOWVDxfv7pckkXDuU10j9XmhvM59GMgy8bmfDvzQ\nRmQPQXljz97gYD3zN+kXFBIbhR8qwcY6jjtC1C6wKwwtUQ/KIkcySUZirtt2\nNO6w58T7UkI3IsFlhQNa3/JYUa+IoHtk3B22HFeYAuLplFaLppqCw6b4bNCu\nN56sxRGdRf/q0gDUt0QCNNUVOETSGi3oxD0mzDSCbkSoTG0AFFvhvMQQQwDO\nxFbx\r\n=fqyl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZbwHqanh5x9lPy3xBWqzwYZVrj4OCY+Or+c1DZp6ZvQIhAKL+NWfMLfMIC/t1sevlwrpBhhxwdTNVCnUy/NfGz1YB"}]},"directories":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttapi_4.0.1_1615017049561_0.9955316490909765"},"_hasShrinkwrap":false},"4.0.2":{"name":"ttapi","description":"A turntable.fm API","version":"4.0.2","author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"dependencies":{"node-fetch":"^2.6.1","ws":"^7.4.3"},"devDependencies":{"dotenv":"^8.2.0"},"engines":{"node":">= 12"},"exports":{".":{"import":"./wrapper.mjs","default":"./src/index.js"}},"keywords":["realtime","stickybits","turntable","turntable.fm"],"main":"./src/index.js","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"scripts":{"start":"node --require dotenv/config ./examples/chat_bot.mjs"},"gitHead":"22908c993b4cb8d2828576302df3c271e2e15151","bugs":{"url":"https://github.com/alaingilbert/Turntable-API/issues"},"homepage":"https://github.com/alaingilbert/Turntable-API#readme","_id":"ttapi@4.0.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"dist":{"integrity":"sha512-AXlFWigddZ3tPS5kgldOWwK8d4j4QwnPR04lFBHL7gw3U6ZKnx9kpJ0oqkJi+X+3Qa6jvVt6aH+kJ0CjS/NhSA==","shasum":"b77a7b177f90249157a1df6241e8ead75a5b2beb","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-4.0.2.tgz","fileCount":6,"unpackedSize":51262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbi/pCRA9TVsSAnZWagAARh4P/0FY2FDvLk+SinPb7O9K\nq39aPe7HrSsiZjdQZfb+0Bhv3OBGA8bmXo7ZB+UPxCdD7Ch+B/toj10UbqYw\nkXX0HUKuhBJ2m/OHrYfTFlAgemdt0Wigy1q6bIcQZPAyhdV9veyDCG7x42RY\nKBMPELDv7x9TG5eHkdea7bZyR11RENj+KLpNR5D9F7qlok4uX0gvVQnG0hZB\nh3+G08Qi7olEnM39Udw2GO6HB38BOi5AI+MjqrkNRM0TO+Pdy+4/E2GPoL0n\nnHxDqlUrj8KuaQrYq7Eo+hwocB7J1NEL2RCoJRGnnaWt/vUSEpgKuaKSsjCx\ntENriKJnmd/P19IRTmr7HtXp6oDeBVXFl+XZ1au7X9O6B26yuoG+J1qEekIW\nXiC7kZaaEfYW/AU4sMKA5kzZJbGtCQsyVLfo/lHTVKPMMzuIIs1B3V3rQush\ngT/OQict083O0Pb6Pzxw+9yjetinJGpsUE6o/GKmOK3N0UmD0zSLozLaagOR\netxG1UVGOM+V3ifDX1JEulgsgafv2+yVErLj7Y1RR97y41avtopisGWyzW8+\nUAiPsKNCE2+leuiT7NdM2h7YkuO0JDOJqxkb1IOuS4XXTR5fzILzU134xCkW\n4kFzoBtDp23QGqfIAUppa2rsM8j0OcC2yk+Hfnksv/2AJCMrD6t02aOVvJTs\nHMGu\r\n=Vv1D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrvt0XKjoV3I9nFKODexCftYIdGfJ+H7UBJXHTUkx5fAIgLnk3nU7oYoHieuuctYEU9OksugOUbfoq6aHetSJcVYU="}]},"directories":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttapi_4.0.2_1617833961210_0.7088781383496001"},"_hasShrinkwrap":false},"4.0.3":{"name":"ttapi","description":"A turntable.fm API","version":"4.0.3","author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"dependencies":{"node-fetch":"^2.6.1","ws":"^7.4.3"},"devDependencies":{"dotenv":"^8.2.0"},"engines":{"node":">= 12"},"exports":{".":{"import":"./wrapper.mjs","default":"./src/index.js"}},"keywords":["realtime","stickybits","turntable","turntable.fm"],"main":"./src/index.js","repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"scripts":{"start":"node --require dotenv/config ./examples/chat_bot.mjs"},"gitHead":"c9cf77919e24411cfe0cf9f35a9bdc88461677ce","bugs":{"url":"https://github.com/alaingilbert/Turntable-API/issues"},"homepage":"https://github.com/alaingilbert/Turntable-API#readme","_id":"ttapi@4.0.3","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","_npmUser":{"name":"agilbert","email":"alain.gilbert.15@gmail.com"},"dist":{"integrity":"sha512-S1Q9yXqtsqVtESpb8HwCo+//i4Fc6OCdxiuG4ZPZVPVK1B8xcWu0ryg3i7Fp0gLFYgViqQWhT81yqR27SjkOBg==","shasum":"000d5e1e7e088261ebb5f08d203017d705d1890d","tarball":"https://registry.npmjs.org/ttapi/-/ttapi-4.0.3.tgz","fileCount":6,"unpackedSize":51374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcq+yCRA9TVsSAnZWagAAtkQP/A1o8bv2odL8CjPPpNEU\nS6hu7O0sMuUprUvET2Z02sbOrLMCMw31lzA9Y00T+BTNXkQK6gld8LAEjfce\naiRBgvqHYKXjZajpPHO3g70TYrR7PXFhN34tBZlKMGwiBpyStD/NR0qjplDz\n1GHCpmq9+jRLBWOdDjh7GOEHd5Fqe9o7k91JNiWT9SrhM28kH/A5vFubiu2/\nSidGMLXcZ6d/cxrr3y6yx0zhVrtju6GzGceSmc/OuIQMPLL4ey246bv0nw3G\nF/v1oOSoy9wuG25gtPDaCnrOIOYVnrpbxDWMvSdCEVtKS5D63X2Xzu5ekIow\n92eeEYZNxvBZBSdXmRrRlzFFOTJCfzKd2KtTCJVlQycfe9QQY7v0PV/sutOr\nbRZ18Qz0NyqTUMFCw63iYUXQNzaq5j3zSULJZACMy/8V0cbhvzmJUN2/eeAc\nSxvhskhf1nUI9Ei5efDWiAlE0XMnnUpLWWy9OKOT9svDbnLJKianv490Knh6\nXWJSC0bbwFNGP4FYu7smxfgAzyjtGKHShbS2qdBQahaAEcrXhvi7LRtwVhdt\nyjgNW8/qA3RICNRLGl8gBwjLAC5qWsyv4hM7ouiqWsw46BLCxfMSufQ7yFMd\nxvthKWF1khHZB2CvQclS+5172q8vPtTxCgSs3YOONg5ILgO0VVWS3bfa66C4\nNpY9\r\n=gBil\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYWMNxqZYcoeiSLBCbvGWHaNWQHxEgV5iRMvwnYJlucAiAD9X6X25TLBmurFC0cQM/Xz09l89KU+ajjVRH54krxGw=="}]},"directories":{},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ttapi_4.0.3_1618128817584_0.04891005302302398"},"_hasShrinkwrap":false}},"maintainers":[{"name":"agilbert","email":"alain.gilbert.15@gmail.com"}],"time":{"modified":"2022-06-27T22:55:47.329Z","created":"2011-09-05T00:36:13.026Z","0.0.0":"2011-12-07T14:46:17.411Z","0.0.1":"2011-12-07T14:46:17.411Z","0.0.2":"2011-12-07T14:46:17.411Z","0.0.3":"2011-12-07T14:46:17.411Z","0.0.4":"2011-12-07T14:46:17.411Z","0.0.5":"2011-12-07T14:46:17.411Z","0.1.0":"2011-12-07T14:46:17.411Z","0.2.0":"2011-12-07T14:46:17.411Z","0.2.1":"2011-12-07T14:46:17.411Z","0.2.2":"2011-12-07T14:46:17.411Z","0.2.3":"2011-12-07T14:46:17.411Z","0.2.4":"2011-12-07T14:46:17.411Z","0.2.5":"2011-12-07T14:46:17.411Z","0.2.6":"2011-12-07T14:46:17.411Z","0.2.7":"2011-12-07T14:46:17.411Z","0.2.8":"2011-12-07T14:46:17.411Z","0.3.0":"2011-12-07T14:46:17.411Z","0.3.1":"2011-12-07T14:46:17.411Z","0.3.2":"2011-12-07T14:46:17.411Z","0.3.3":"2011-12-07T14:46:17.411Z","0.3.4":"2011-12-07T14:46:17.411Z","0.4.0":"2011-12-07T14:46:17.411Z","0.4.1":"2011-12-07T14:46:17.411Z","0.4.2":"2011-12-07T14:46:17.411Z","0.4.3":"2011-12-07T14:46:17.411Z","0.4.4":"2011-12-07T14:46:17.411Z","0.4.5":"2011-12-07T14:46:17.411Z","0.4.6":"2011-11-10T06:16:19.521Z","0.4.7":"2011-11-12T08:05:18.801Z","0.4.8":"2011-11-14T09:10:11.452Z","1.0.0":"2011-11-16T05:34:36.427Z","1.0.1":"2011-11-18T20:46:31.045Z","1.0.2":"2011-11-29T21:12:45.066Z","1.0.3":"2011-11-30T06:04:16.800Z","1.0.4":"2011-12-07T14:46:17.411Z","1.0.5":"2011-12-14T04:57:37.638Z","1.0.6":"2011-12-15T15:42:25.861Z","1.0.7":"2011-12-16T07:20:04.534Z","1.0.8":"2011-12-16T11:21:44.865Z","1.0.9":"2012-01-19T06:18:52.403Z","1.0.10":"2012-01-19T19:00:40.088Z","1.0.11":"2012-01-19T19:21:25.030Z","1.0.12":"2012-01-22T07:02:12.344Z","1.1.0":"2012-01-22T08:02:59.815Z","1.1.1":"2012-01-22T08:16:58.187Z","1.1.2":"2012-01-23T19:53:47.724Z","1.1.3":"2012-01-23T20:32:24.133Z","1.1.4":"2012-01-23T21:06:00.790Z","1.1.5":"2012-02-02T04:06:33.884Z","1.1.6":"2012-02-02T04:28:23.958Z","1.2.0":"2012-02-21T21:17:22.792Z","1.2.1":"2012-02-21T22:09:36.833Z","1.2.2":"2012-03-30T20:22:51.284Z","1.2.3":"2012-03-30T23:51:45.123Z","1.2.4":"2012-04-20T05:28:00.160Z","1.3.0":"2012-04-23T21:29:45.036Z","1.3.1":"2012-04-24T00:18:02.204Z","1.3.2":"2012-04-24T21:59:02.442Z","1.4.0":"2012-05-09T22:18:20.523Z","1.4.1":"2012-05-16T02:22:41.560Z","1.4.2":"2012-05-16T03:00:09.935Z","1.4.3":"2012-06-23T02:03:52.763Z","1.4.4":"2012-08-29T21:02:47.719Z","1.4.5":"2012-09-05T17:00:04.421Z","1.4.6":"2012-09-06T02:05:58.720Z","1.5.0":"2012-09-06T04:20:24.201Z","1.5.1":"2012-11-03T19:48:17.558Z","1.5.2":"2012-12-01T04:39:24.871Z","1.5.3":"2012-12-25T21:50:31.900Z","1.5.4":"2013-01-16T16:45:52.084Z","2.0.0":"2013-02-07T03:48:35.329Z","2.0.1":"2013-02-17T05:19:15.120Z","2.1.0":"2013-02-25T02:40:35.289Z","2.1.1":"2013-02-25T20:14:30.611Z","2.1.2":"2013-02-25T20:16:29.107Z","2.1.3":"2013-02-28T23:19:12.583Z","2.1.4":"2013-02-28T23:27:20.214Z","2.1.5":"2013-03-12T16:14:15.758Z","2.1.6":"2013-03-18T19:15:45.408Z","2.1.7":"2013-03-21T13:55:51.242Z","2.1.8":"2013-03-26T02:11:38.040Z","2.1.9":"2013-04-18T13:33:19.837Z","2.1.10":"2013-05-06T04:54:45.281Z","2.2.0":"2013-05-06T23:45:23.004Z","2.3.0":"2013-05-25T02:33:33.724Z","2.3.1":"2013-05-25T03:16:34.028Z","2.3.2":"2013-05-29T22:06:54.655Z","2.4.0":"2013-06-19T03:52:58.603Z","2.4.1":"2013-06-20T02:35:26.209Z","2.4.2":"2013-06-26T00:33:41.897Z","3.0.0":"2013-06-27T17:08:37.751Z","3.0.1":"2013-07-08T17:53:56.519Z","3.1.0":"2013-07-10T03:18:52.197Z","3.1.1":"2013-10-30T14:46:51.392Z","3.1.2":"2013-11-07T14:34:15.275Z","4.0.0":"2021-03-06T02:44:33.962Z","4.0.1":"2021-03-06T07:50:49.739Z","4.0.2":"2021-04-07T22:19:21.411Z","4.0.3":"2021-04-11T08:13:37.751Z"},"author":{"name":"Alain Gilbert","email":"alain.gilbert.15@gmail.com","url":"http://agilbert.name/"},"repository":{"type":"git","url":"git://github.com/alaingilbert/Turntable-API.git"},"homepage":"https://github.com/alaingilbert/Turntable-API#readme","keywords":["realtime","stickybits","turntable","turntable.fm"],"contributors":[{"name":"Jeff Stieler","email":"jeff.m.stieler@gmail.com","url":"http://jeffstieler.com"}],"bugs":{"url":"https://github.com/alaingilbert/Turntable-API/issues"},"readme":"# Turntable API\r\n\r\n-----\r\n\r\nJoin us on Discord https://discord.gg/4AA2DqWpVc\r\n\r\n-----\r\n\r\nA simple nodejs wrapper for the turntable API.\r\nYou'll need to find your `AUTH`, `USERID` and `ROOMID` information with [this bookmarklet](http://alaingilbert.github.com/Turntable-API/bookmarklet.html).\r\n\r\nTtapi is also available in [Python](https://github.com/alaingilbert/Turntable-API/tree/python_ttapi) and [Ruby](https://github.com/alaingilbert/Turntable-API/tree/ruby_ttapi).\r\n\r\nSee also [turntabler](https://github.com/obrie/turntabler) (Ruby) maintained by [obrie](https://github.com/obrie).\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install ttapi\r\n```\r\n\r\n## Examples\r\n\r\n### Chat bot\r\n\r\nThis bot responds to anybody who writes \"/hello\" in the chat.\r\n\r\n```js\r\nvar Bot = require('ttapi');\r\nvar bot = new Bot(AUTH, USERID, ROOMID);\r\n\r\nbot.on('speak', function (data) {\r\n  // Respond to \"/hello\" command\r\n  if (data.text.match(/^\\/hello$/)) {\r\n    bot.speak('Hey! How are you @'+data.name+' ?');\r\n  }\r\n});\r\n```\r\n\r\n### Logger\r\n\r\nThis bot logs the room activity in the console.\r\n\r\n```js\r\nvar Bot    = require('ttapi');\r\nvar AUTH   = 'xxxxxxxxxxxxxxxxxxxxxxxx';\r\nvar USERID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\r\nvar ROOMID = 'xxxxxxxxxxxxxxxxxxxxxxxx';\r\n\r\nvar bot = new Bot(AUTH, USERID);\r\n\r\nbot.on('ready',        function (data) { bot.roomRegister(ROOMID); });\r\nbot.on('roomChanged',  function (data) { console.log('The bot has changed room.', data); });\r\n\r\nbot.on('speak',        function (data) { console.log('Someone has spoken', data); });\r\nbot.on('update_votes', function (data) { console.log('Someone has voted',  data); });\r\nbot.on('registered',   function (data) { console.log('Someone registered', data); });\r\n```\r\n\r\n### Dynamic bot\r\n\r\n[REPL](https://nodejs.org/docs/latest-v14.x/api/repl.html) allows you to dynamically call the bot functions and modify his variables during his execution.\r\n\r\n```js\r\nvar Bot  = require('ttapi')\r\n  , repl = require('repl');\r\n\r\nvar bot = new Bot(AUTH, USERID, ROOMID);\r\nrepl.start('> ').context.bot = bot;\r\n\r\n// ...\r\n```\r\n\r\n# Debugging\r\n\r\n```js\r\nbot.debug = true;\r\n```\r\n\r\nThat will print on the terminal all the data that you get and all the data that you send.\r\n\r\n# Hosting\r\n\r\n* [https://c9.io/](https://c9.io/) : Free (up to 128MB memory/storage) hosting for nodejs-based projects with full SSH access, FTP, and unlimited collaborators.\r\n* [https://openshift.redhat.com/](https://openshift.redhat.com/) : Free (up to 1.5GB memory/3GB storage) Git-based PaaS service that supports nodejs with limited SSH access.\r\n* [http://www.heroku.com/](http://www.heroku.com/) : Free (up to 1 dyno/512MB memory/200MB storage) Git-based PaaS service that supports nodejs with a easy-to-use frontend.\r\n* [http://nodester.com/](http://nodester.com/) : Free (unlimited applications/50GB transfer/up to 2GB memory) PaaS service that supports nodejs and comes with easy deployment options.\r\n* [https://modulus.io/](https://modulus.io/) : Cheap (scaleable memory not to be abused) nodejs hosting with $25 credit for a limited time.\r\n* [http://www.nodejitsu.com/](http://www.nodejitsu.com/) : Cheap (scaleable memory/storage not to be abused) hosting for nodejs-based projects.\r\n\r\n# Documentation\r\n\r\n\r\n## Events\r\n\r\n[Here are some examples of the data that you'll receive from those events.](https://github.com/alaingilbert/Turntable-API/tree/master/turntable_data)\r\n\r\n### on('ready', function ( ) { })\r\n\r\nTriggered when the bot is connected. Do not attempt to use any actions until you receive this event.\r\n\r\n### on('error', function (error:Error) { })\r\n\r\nTriggered when attempting to connect using an invalid roomid.\r\n\r\n##### Warning\r\n\r\nIf you do not handle this event, your bot will stop running when this error occurs.\r\n\r\n### on('disconnected', function (error:Error) { })\r\n\r\nTriggered on recoverable connection errors.\r\n\r\n###### Note\r\n\r\nIf you do not handle this event, an ``error`` event will be triggered when the connection to Turntable is lost.\r\n\r\n### on('tcpConnect', function (socket) { })\r\n\r\nTriggered when a socket opens a connection.\r\n\r\n### on('tcpMessage', function (socket, msg) { })\r\n\r\nTriggered when the bot receives a TCP message.\r\n\r\n### on('tcpEnd', function (socket) { })\r\n\r\nTriggered when a socket closes its connection.\r\n\r\n### on('httpRequest', function (request, response) { })\r\n\r\nTriggered when the bot receives an HTTP request.\r\n\r\n### on('roomChanged', function ([data](turntable_data/room_infos.js)) { })\r\n\r\nTriggered when the bot enters a room.\r\n\r\n### on('registered', function ([data](turntable_data/registered.js)) { })\r\n\r\nTriggered when a user enters the room.\r\n\r\n### on('deregistered', function ([data](turntable_data/deregistered.js)) { })\r\n\r\nTriggered when a user leaves the room.\r\n\r\n### on('speak', function ([data](turntable_data/speak.js)) { })\r\n\r\nTriggered when a new message is sent via the chat.\r\n\r\n### on('endsong', function ([data](turntable_data/endsong.js)) { })\r\n\r\nTriggered at the end of the song. (Just before the newsong/nosong event)\r\n\r\nThe data returned by this event contains information about the song that has just ended.\r\n\r\n### on('newsong', function ([data](turntable_data/newsong.js)) { })\r\n\r\nTriggered when a new song starts.\r\n\r\n### on('nosong', function ([data](turntable_data/nosong.js)) { })\r\n\r\nTriggered when there is no song.\r\n\r\n### on('update_votes', function ([data](turntable_data/update_votes.js)) { })\r\n\r\nTriggered when a user votes.\r\n\r\n###### Note\r\n\r\nThe userid is provided only if the user votes up, or later changes their mind and votes down.\r\n\r\n### on('booted_user', function (data) { })\r\n\r\nTriggered when a user gets booted.\r\n\r\n### on('update_user', function (data) { })\r\n\r\nTriggered when a user updates their name/profile.\r\n\r\n### on('add_dj', function ([data](turntable_data/add_dj.js)) { })\r\n\r\nTriggered when a user takes a dj spot.\r\n\r\n### on('rem_dj', function ([data](turntable_data/rem_dj.js)) { })\r\n\r\nTriggered when a user leaves a dj spot.\r\n\r\n### on('escort', function ([data](turntable_data/escort.js)) { })\r\n\r\nTriggered when a user is escorted off the stage.\r\n\r\n### on('new_moderator', function ([data](turntable_data/new_moderator.js)) { })\r\n\r\nTriggered when a user is promoted to a moderator.\r\n\r\n### on('rem_moderator', function ([data](turntable_data/rem_moderator.js)) { })\r\n\r\nTriggered when a user loses their moderator title.\r\n\r\n### on('snagged', function ([data](turntable_data/snagged.js)) { })\r\n\r\nTriggered when a user queues the currently playing song.\r\n\r\n### on('pmmed', function ([data](turntable_data/pmmed.js)) { })\r\n\r\nTriggered when the bot receives a private message.\r\n\r\n\r\n## Actions\r\n\r\n### tcpListen ( port, address )\r\n\r\nStart a TCP server.\r\n\r\n### listen ( port, address )\r\n\r\nStart an HTTP server.\r\n\r\n### roomNow ( [callback:fn] )\r\n\r\nGet the Turntable server time.\r\n\r\n### listRooms ( skip=0:int [, callback:fn] )\r\n\r\nGet 20 rooms.\r\n\r\n### searchRooms( [options:obj, ]callback:fn )\r\n\r\nSearch the directory for rooms.\r\n\r\n##### options\r\n\r\n* `limit` - The number of rooms to return\r\n* `query` - Filter based on this search term\r\n\r\n### directoryGraph ( callback:fn )\r\n\r\nGet the location of your friends/idols.\r\n\r\n### directoryRooms( options:obj, callback:fn )\r\n\r\nGet a directory of rooms.\r\n\r\n##### options\r\n\r\n* `limit` - The number of rooms to return\r\n* `section_aware`\r\n* `sort` - What to sort by,\r\n* `skip` - The number of rooms to skip\r\n\r\n### stalk ( userId:string [, allInformation=false:bool ], callback:fn )\r\n\r\nGet the location of a user. If `allInformation` is `true`, you'll also receive the information about the room and the user.\r\n\r\n###### Warning\r\n\r\nThis function will make you become a fan of the user.\r\n\r\n### getFavorites ( callback:fn )\r\n\r\nGet your favorite rooms.\r\n\r\n### addFavorite ( roomId:string [, callback:fn ] )\r\n\r\nAdd a room to your favorite rooms.\r\n\r\n### remFavorite ( roomId:string [, callback:fn ] )\r\n\r\nRemove a room from your favorite rooms.\r\n\r\n### roomRegister ( roomId:string [, callback:fn] )\r\n\r\nRegister in a room.\r\n\r\n### roomDeregister ( [callback:fn] )\r\n\r\nDeregister from the current room.\r\n\r\n### roomInfo ( [[extended=true:bool, ]callback:fn] )\r\n\r\nGet the current room information. Do not include song log if 'extended' is false.\r\n\r\n### speak ( msg:string [, callback:fn] )\r\n\r\nBroadcast a message in the chat.\r\n\r\n### bootUser ( userId:string, reason:string [, callback:fn] )\r\n\r\nBoot a user.\r\n\r\n### boot ( userId:string, reason:string [, callback:fn] )\r\n\r\nAlias of `bootUser()`.\r\n\r\n### addModerator ( userId:string [, callback:fn] )\r\n\r\nAdd a moderator.\r\n\r\n### remModerator ( userId:string [, callback:fn] )\r\n\r\nRemove a moderator. (Note the person does NOT have to be in the room to remove their moderator status.)\r\n\r\n### addDj ( [callback:fn] )\r\n\r\nAdd yourself as a DJ.\r\n\r\n### remDj ( [[userId:string, ]callback:fn] )\r\n\r\nRemove the specified DJ, or yourself if not specified.\r\n\r\n### stopSong ( [callback:fn] )\r\n\r\nStop the currently playing song. You must be a moderator to stop playing someone else's song.\r\n\r\n###### Note\r\n\r\nThis cannot affect other DJs.\r\n\r\n### skip ( [callback:fn] )\r\n\r\nAlias of `stopSong()`.\r\n\r\n### vote ( val:enum('up', 'down') [, callback:fn] )\r\n\r\nVote for the current song.\r\n\r\n### bop ( )\r\n\r\nAlias of `vote('up')`.\r\n\r\n### userAuthenticate ( [callback:fn] )\r\n\r\nAuthenticate the user.\r\n\r\n### userInfo ( [callback:fn] )\r\n\r\nGet the current user's information.\r\n\r\n### userAvailableAvatars ( callback:fn )\r\n\r\nGet all available avatars.\r\n\r\n### getAvatarIds ( callback:fn )\r\n\r\nGet the avatar ids that you can currently use.\r\n\r\n### getFanOf ( [[userId:string, ]callback:fn )\r\n\r\nGet the list of everyone the specified userid is a fan of, or the list of everyone you are a fan of if a userid is not specified.\r\n\r\n### getFans ( [[userId:string, ]callback:fn )\r\n\r\nGet the list of everyone who is a fan of the specified userid, or the list of everyone who is your fan if a userid is not specified.\r\n\r\n##### example\r\n\r\n```js\r\nbot.getFans(function (data) { console.log(data); });\r\n// { msgid: 7, fans: [ '4e69c14e4fe7d00e7303cd6d', ... ], success: true }\r\n```\r\n\r\n### getUserId ( name:string, callback:fn )\r\n\r\nGet a user's id by their name.\r\n\r\n##### Example\r\n\r\n```js\r\nbot.getUserId('@alain_gilbert', function (data) { console.log(data); });\r\n// { msgid: 12, userid: '4deadb0f4fe7d013dc0555f1', success: true }\r\n\r\n```\r\n\r\n### getPresence ( [[userId:string, ]callback:fn] )\r\n\r\nGet presence for the specified user, or your presence if a userid is not specified.\r\n\r\n### getProfile ( [[userId:string, ]callback:fn] )\r\n\r\nGet the profile for the specified user, or your profile if a userid is not specified.\r\n\r\n### modifyProfile ( profile:obj [, callback:fn] )\r\n\r\nModify your profile. Any missing properties from the 'profile' object will be replaced with the current values.\r\n\r\n##### Arguments\r\n\r\n* `profile`:obj (required)\r\n  * `name`:string (optional)\r\n  * `twitter`:string (optional)\r\n  * `soundcloud`:string (optional)\r\n  * `facebook`:string (optional)\r\n  * `website`:string (optional)\r\n  * `about`:string (optional)\r\n  * `topartists`:string (optional)\r\n  * `hangout`:string (optional)\r\n* `callback`:fn (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.modifyProfile({ website:'http://ttdashboard.com/', about:'My bot.' }, callback);\r\n```\r\n\r\n### modifyLaptop ( laptop:enum('linux', 'mac', 'pc', 'chrome' , 'iphone', 'android') [, callback:fn] )\r\n\r\nModify your laptop.\r\n\r\n### modifyName ( name:string [, callback:fn] )\r\n\r\nModify your name.\r\n\r\n### setAvatar ( avatarId:int [, callback:fn] )\r\n\r\nSet your avatar.\r\n\r\n### becomeFan ( userId:string [, callback:fn] )\r\n\r\nFan someone.\r\n\r\n### removeFan ( userId:string [, callback:fn] )\r\n\r\nUnfan someone.\r\n\r\n### snag ( [ callback:fn ] )\r\n\r\nTrigger the heart animation used to show that you've snagged the currently playing song.\r\n\r\n###### Warning\r\n\r\nThis function will not add the song into the queue. Use `.playlistAdd` to queue the song, and if successful, then use `.snag` to trigger the animation.\r\n\r\n### pm (msg:string, receiverId:string [, callback:fn] )\r\n\r\nSend a private message.\r\n\r\n### pmHistory ( receiverId:string, callback:fn )\r\n\r\nGet the private conversation history.\r\n\r\n### setStatus ( status:enum('available', 'unavailable', 'away') [, callback:fn ] )\r\n\r\nSet your current status.\r\n\r\n### setAsBot ( callback:fn )\r\n\r\nSet the user to be considered a bot. This puts the user under the \"Bots\" group in the room list. A good place to run this command is in the callback to `.roomRegister`. \r\n\r\n```js\r\nbot.roomRegister(roomid, function() {\r\n  bot.setAsBot();\r\n});\r\n```\r\n\r\n### playlistListAll ( callback:fn )\r\n\r\nList all your playlists.\r\n\r\n### playlistCreate ( playlistName:string [ , callback:fn ] )\r\n\r\nCreate a new playlist.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (required)\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistCreate(newPlaylistName)\r\nbot.playlistCreate(newPlaylistName, callback)\r\n```\r\n\r\n### playlistDelete ( playlistName:string [ , callback:fn ] )\r\n\r\nDelete a playlist.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (required)\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistDelete(playlistName)\r\nbot.playlistDelete(paylistName, callback)\r\n```\r\n\r\n### playlistRename ( oldPlaylistName:string, newPlaylistName:string [ , callback:fn ] )\r\n\r\nRename a playlist.\r\n\r\n##### Arguments\r\n\r\n* `oldPlaylistName` (required)\r\n* `newPlaylistName` (required)\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistRename(oldPlaylistName, newPlaylistName)\r\nbot.playlistRename(oldPlaylistName, newPlaylistName, callback)\r\n```\r\n\r\n### playlistSwitch ( playlistName:string [ , callabck:fn ] )\r\n\r\nSwitch to another playlist.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (required)\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistSwitch(playlistName)\r\nbot.playlistSwitch(playlistName, callback)\r\n```\r\n\r\n### playlistAll ( [ playlistName:string, ] callback:fn )\r\n\r\nGet all information about a playlist.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (optional) default: `default`\r\n* `callback` (required)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistAll(callback);\r\nbot.playlistAll(playlistName, callback);\r\n```\r\n\r\n### playlistAdd ( [ playlistName:string, ] songId:string [, index:int [, callback:fn]] )\r\n\r\nAdd a song to a playlist.\r\n\r\n#### Arguments\r\n\r\n* `playlistName` (optional) default: `default`\r\n* `songId` (required)\r\n* `index` (optional) default: `0`\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistAdd(songId);\r\nbot.playlistAdd(songId, idx);\r\nbot.playlistAdd(songId, callback);\r\nbot.playlistAdd(songId, idx, callback);\r\nbot.playlistAdd(playlistName, songId, idx);\r\nbot.playlistAdd(playlistName, songId, callback);\r\nbot.playlistAdd(playlistName, songId, idx, callback);\r\nbot.playlistAdd(false, songId, callback); // Backward compatibility\r\nbot.playlistAdd(false, songId);           // Backward compatibility\r\n````\r\n\r\n### playlistRemove ( [ playlistName:string, ] index:int [, callback:fn ] )\r\n\r\nRemove a song on a playlist.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (optional) default: `default`\r\n* `index` (optional) default: `0`\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n```js\r\nbot.playlistRemove();\r\nbot.playlistRemove(index);\r\nbot.playlistRemove(index, callback);\r\nbot.playlistRemove(playlistName, index);\r\nbot.playlistRemove(playlistName, index, callback);\r\n```\r\n\r\n### playlistReorder ( [ playlistName:string, ] indexFrom:int, indexTo:int [, callback:fn ] )\r\n\r\nReorder a playlist. Take the song at index `indexFrom` and move it to index `indexTo`.\r\n\r\n##### Arguments\r\n\r\n* `playlistName` (optional) default: `default`\r\n* `indexFrom` (required) default: `0`\r\n* `indexTo` (required) default: `0`\r\n* `callback` (optional)\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.playlistReorder(indexFrom, indexTo);\r\nbot.playlistReorder(indexFrom, indexTo, callback);\r\nbot.playlistReorder(playlistName, indexFrom, indexTo);\r\nbot.playlistReorder(playlistName, indexFrom, indexTo, callback);\r\n```\r\n\r\n### searchSong ( query:string, callback:fn )\r\n\r\nSearch for songs.\r\n\r\n##### Arguments\r\n\r\n* `query`\r\n* `callback`\r\n\r\n##### Examples\r\n\r\n```js\r\nbot.searchSong(query, callback);\r\n```\r\n\r\n### getStickers ( callback:fn )\r\n\r\nGet all stickers information.\r\n\r\n##### Example\r\n\r\n```js\r\nbot.getStickers(function (data) { console.log(data); });\r\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickers.js\r\n```\r\n\r\n### getStickerPlacements ( userid:string, callback:fn )\r\n\r\nGet the information about a user's stickers.\r\n\r\n##### Example\r\n\r\n```js\r\nbot.getStickerPlacements('4e0889d4a3f7517d1100af78', function (data) { console.log(data); });\r\n// https://github.com/alaingilbert/Turntable-API/blob/master/turntable_data/getstickerplacements.js\r\n```\r\n### placeStickers ( placements:array.&lt;object&gt; [, callback:fn] )\r\n\r\nSets your sticker placements.  The placements object is formatted the same as the placements object retrieved\r\nin the getStickerPlacements callback.\r\n\r\n##### Example\r\n\r\n```js\r\nvar placements = [{\r\n  top: 126,\r\n  angle: -23.325931577,\r\n  sticker_id: '4f86fe84e77989117e000008',\r\n  left: 78\r\n}];\r\nbot.placeStickers(placements);\r\n```\r\n","readmeFilename":"README.md"}