Search code examples
node.jsvine

unofficial vine api not working


I am trying to connect to the vine API to retrieve the list of uploaded videos of a given user. I'm using a node.js module called Vineapple.

The problem is some of the api endpoints seems to not work anymore


Here is a snippet that works

var vine = new vineapple({
    key: 'some-key',
    userId: '123456789',
    username: 'user',
}); 
vine.me(function(err, response){  // calls 'https://api.vineapp.com/users/me'
    if(err) throw err;
    console.log(response);
});

This logs the whole vine user's settings:

{ followerCount: 300,
  includePromoted: 2,
  userId: '123456789',
  private: 0,
  likeCount: 30,
  ... etc }

And here is a snippet that does not work

var vine = new vineapple({
    key: 'some-key',
    userId: '123456789',
    username: 'user',
}); 
vine.user(connectionObject.userId.toString(), function(err, response){    // calls 'https://api.vineapp.com/timelines/users/{userId}'
    if(err) throw err;
    console.log(response);
});

This never return anything.

Are all the vine api endpoints still available?

  • If yes, what could be my problem?
  • If no, is there another solution to retrieve vine videos?

Thanks


Solution

  • For those who are wondering.

    As for today (april 2014), the vine unofficial api is still up. You can test it if here : https://api.vineapp.com/timelines/users/920890957405237248

    I had a problem with the node.js vineapple module:

    1/ You should always call vineapple functions with promise syntax: https://github.com/furf/vineapple#promises

    2/ Vine use big int as user ids, js cannot handle those so you should send userId as js strings and not numbers (I stored it as ints. The .toString() was useless here)

    3/ There is a known bug in vineapple module, you should comment line 121 of vineapple.js: https://github.com/furf/vineapple/issues/2

    As a conclusion, here is how my code look like:

    var vine = new vineapple({
        key: key,
        userId: userId,     // Stored as String !
        username: username,
    });
    options= {page: '1', size: '20'};
    
    vine.user(userId, options).then(function (response) {
        console.log('SUCCESS', response);
    }).fail(function (error) {
        console.log('ERROR', error);
    });
    

    Hope it helps