DEV Community

Discussion on: How I Created Two Twitter Bots

Collapse
 
srivinprabhash profile image
Srivin Prabhash

I tried this. But when I ran node bot.js it gives me this TypeError

TypeError: Cannot read property 'id_str' of undefined

I don't have any knowledge on node though -_- .. Any idea to fix this ?

Collapse
 
bengreenberg profile image
Ben Greenberg

Hey Srivin,

It sounds like you are not getting back from the Twitter API what you are expecting to get back. The first step to debugging this would be to check what data is, perhaps by putting it in a console.log and then working backwards step-by-step to see where in the chain of events you are not either a) sending the right credentials to Twitter or b) not getting back the right data.

Good luck!

Ben