【发布时间】:2017-12-13 00:38:11
【问题描述】:
===================这是我下面的代码=========================
函数 spotifyThisSong() {
var spotify = 新的 Spotify({
id: 'myid',
秘密:“我的秘密”
});
var songName = process.argv[3];
如果(!歌曲名){
songName = "我又几岁了";
}
变量参数 = 歌曲名;
spotify.search({ type: 'track', query: params }, function(err, data) {
如果(错误){
console.log('发生错误:' + err);
返回; //来自 spotify npm 文档
}
别的{
控制台.log(数据);
};
});
}
===================代码结束==========================
一直给我未定义。我需要提取歌曲名称、年份、专辑及其网址。提前致谢。
【问题讨论】:
-
不可读,请正确格式化。
-
您好,欢迎来到 StackOverflow。请花一些时间阅读帮助页面,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。更重要的是,请阅读the Stack Overflow question checklist。您可能还想了解Minimal, Complete, and Verifiable Examples。
-
我很抱歉发布得太快而没有编辑它。我希望这个版本更好。