A2Z-F17 icon indicating copy to clipboard operation
A2Z-F17 copied to clipboard

Bad Twitter streaming request: 410

Open raunakhajela opened this issue 6 years ago • 1 comments

I am trying to make a follow bot which posts a tweet when someone follows bot from this tutorial https://www.youtube.com/watch?v=ZvsqQjwrISQ&t=1s however, it's not working and I am getting following error:

234423423

Here is my code:

console.log('The follow bot is starting');

var Twit = require('twit')

var config = require('./config');
var T = new Twit(config);

//setting up a user stream
var stream = T.stream('user');

//anytime someone follows me
stream.on('follow', followed);

function followed(eventMsg){
    console.log('Follow event!');
    var name = eventMsg.source.name;
    var screenName = eventMsg.source.screen_name;
    tweetIt('.@' + screenName + ' do you like pizza?');
}

// tweetIt();
// setInterval(tweetIt, 1000*20);

function tweetIt(txt){

    var tweet = {
        status: txt
    };

    T.post('statuses/update', tweet, tweeted);

    function tweeted(err, data, response){
        if(err){
            console.log("Something went wrong!");
        }else{
            console.log("It worked!");
        }
    }
}

raunakhajela avatar Sep 07 '18 13:09 raunakhajela

Bad Request 410 indicates that the resource is gone.

User Streams and Site Streams will flicker periodically for one week. At the end of that week, on August 23, new connections to them (including control endpoints) will no longer be accepted. We plan to return the following 410 error message during these flicker periods and when we turn off the endpoint

The details of Update can be checked here

manjumjn avatar Sep 07 '18 13:09 manjumjn