好的,这是Twitter API:
http://search.twitter.com/search.atom?q=perkytweets
有没有人能够给我一些提示,如何使用Meteor调用这个API或链接?
更新:
这是我尝试过的代码,但它没有显示任何响应。
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to HelloWorld";
};
Template.hello.events({
'click input' : function () {
checkTwitter();
}
});
Meteor.methods({checkTwitter: function () {
this.unblock();
var result = Meteor.http.call("GET", "http://search.twitter.com/search.atom?q=perkytweets");
alert(result.statusCode);
}});
}
if (Meteor.isServer) {
Meteor.startup(function () {
});
}
HTTP.get()
的文档现在位于 http://docs.meteor.com/#/full/http_get。 - Jon Onstott