alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 97 forks source link

No data for endsong event #30

Closed omega697 closed 12 years ago

omega697 commented 12 years ago

I'm not getting any data for endsong. When I print the value of data, i.e.:

bot.on('endsong', function (data) { console.log(data); });

I just get "undefined".

Do we know what is causing this? AFAIK, I'm using the latest version.

alaingilbert commented 12 years ago

Hum, that's weird.

I just tested it, and this is what I got.

{ command: 'endsong',
  room: 
   { name: 'Coding Soundtrack',
     created: 1307392894.36,
     shortcut: 'coding_soundtrack3',
     name_lower: 'coding soundtrack',
     stream_info: 
      { start_time: 1330021718.31,
        first_seg_id: 1330021718,
        file: '4de93a9b845daf480300007c' },
     metadata: 
      { songlog: [Object],
        dj_full: true,
        djs: [Object],
        random: 0.6939884434,
        upvotes: 28,
        privacy: 'public',
        max_djs: 5,
        downvotes: 1,
        netloc: 'http://d3volxspmrf6x8.cloudfront.net/',
        userid: '4dd8ca0be8a6c40c22000004',
        sync: [Object],
        listeners: 159,
        djcount: 5,
        max_size: 200,
        moderator_id: [Object],
        current_song: [Object],
        creator: [Object],
        current_dj: '4e0611d54fe7d01d08005d4f',
        votelog: [Object] },
     roomid: '4ded3b7e99968e1d29000047',
     description: 'The coding soundtrack is music for geeks and hackers.\nhttp://codingsoundtrack.com/ Autobop & more:  https://github.com/chrisinajar/jarTT' },
  success: true }

On wich room did you test it ? Do you really have the 1.2.1 version of ttapi ? Do you got "undefined" at the first endsong event, or after ?...

omega697 commented 12 years ago

Testing it in the room "Eclectics"

I'm pretty sure I have 1.2.1:

$ npm install ttapi
npm http GET https://registry.npmjs.org/ttapi npm http 304 https://registry.npmjs.org/ttapi ttapi@1.2.1 ./node_modules/ttapi

I'm going to try several subsequent endsongs. But definitely the first one.

omega697 commented 12 years ago

This works fine - I somehow had an old version :o/