我正在尝试连接到vine API以检索给定用户的上载视频列表。我正在使用一个名为Vineapple的node.js模块。
问题是一些api端点似乎不再工作
以下是一个有效的片段
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);
});
这记录了整个藤用户的设置:
{ followerCount: 300,
includePromoted: 2,
userId: '123456789',
private: 0,
likeCount: 30,
... etc }
这里有一个不起作用的片段
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);
});
这永远不会有任何回报。
所有的vine api端点仍然可用吗?
- 如果是,我的问题可能是什么
- 如果没有,是否有另一种检索葡萄藤视频的解决方案
感谢
对于那些想知道的人。
截至今天(2014年4月),vine的非官方api仍在上升。您可以在以下条件下进行测试:https://api.vineapp.com/timelines/users/920890957405237248
我在node.js vineapple模块上遇到了一个问题:
1/您应该始终使用promise语法调用vineapple函数:https://github.com/furf/vineapple#promises
2/Vine使用大int作为用户id,js无法处理这些,所以你应该将userId发送为js字符串,而不是数字(我将其存储为int。.toString()
在这里没用)
3/vineapple模块中有一个已知的错误,您应该vineapple.js的注释行121:https://github.com/furf/vineapple/issues/2
最后,我的代码是这样的:
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);
});
希望它能帮助