1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Twitter doc updates and rate limit fixes

This commit is contained in:
Nicholas O'Leary 2013-11-24 16:48:24 +00:00
parent 9104b4200a
commit cb8a3f064e
2 changed files with 24 additions and 3 deletions

View File

@ -129,7 +129,11 @@
</script> </script>
<script type="text/x-red" data-help-name="twitter in"> <script type="text/x-red" data-help-name="twitter in">
<p>Twitter input node. Watches either the public or the user's stream for tweets containing the configured search term.</p> <p>Twitter input node. Can be used to search either:
<ul><li>the public or a user's stream for tweets containing the configured search term</li>
<li>all tweets by specific users</li>
<li>direct messages received by the authenticated user</li>
</ul></p>
<p>Use space for <i>and</i> and comma , for <i>or</i> when searching for multiple terms.</p> <p>Use space for <i>and</i> and comma , for <i>or</i> when searching for multiple terms.</p>
<p>Sets the <b>msg.topic</b> to <i>tweets/</i> and then appends the senders screen name.</p> <p>Sets the <b>msg.topic</b> to <i>tweets/</i> and then appends the senders screen name.</p>
<p>Sets <b>msg.location</b> to the tweeters location if known.</p> <p>Sets <b>msg.location</b> to the tweeters location if known.</p>
@ -151,7 +155,16 @@
outputs:1, outputs:1,
icon: "twitter.png", icon: "twitter.png",
label: function() { label: function() {
return this.name||this.tags; if (this.name) {
return this.name;
}
if (this.user == "dm") {
var user = RED.nodes.node(this.twitter);
return (user?user.label()+" ":"")+"DMs";
} else if (this.user == "user") {
return this.tags+" tweets";
}
return this.tags;
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";

View File

@ -43,6 +43,14 @@ function TwitterInNode(n) {
access_token_secret: credentials.access_token_secret access_token_secret: credentials.access_token_secret
}); });
//setInterval(function() {
// twit.get("/application/rate_limit_status.json",null,function(err,cb) {
// console.log("direct_messages:",cb["resources"]["direct_messages"]);
// });
//
//},10000);
var node = this; var node = this;
if (this.user === "user") { if (this.user === "user") {
node.poll_ids = []; node.poll_ids = [];
@ -132,7 +140,7 @@ function TwitterInNode(n) {
node.error(err); node.error(err);
} }
}); });
},65000)); },120000));
}); });
} else if (this.tags !== "") { } else if (this.tags !== "") {