Twitter node: Add support for search terms passed in through msg.payload (#235)

* Add support for search terms passed in through msg.payload

* Add support for dynamic left ping connector

* Suggestions from David Conway-Jones

* Better error message

* Add green status indicator when msg.payload is dynamically passed in and revised warning messages
This commit is contained in:
smchamberlin
2016-09-27 17:34:04 +01:00
committed by Dave Conway-Jones
parent 8e84e19cde
commit b0c93e44b8
2 changed files with 33 additions and 7 deletions

View File

@@ -124,7 +124,7 @@
<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. If you want to pass in the term(s) via the <code>msg.payload</code>, leave the field blank.</p>
<p>Sets the <code>msg.topic</code> to <i>tweets/</i> and then appends the senders screen name.</p>
<p>Sets <code>msg.location</code> to the tweeters location if known.</p>
<p>Sets <code>msg.tweet</code> to the full tweet object as documented by <a href="https://dev.twitter.com/overview/api/tweets">Twitter</a>.
@@ -140,7 +140,7 @@
color:"#C0DEED",
defaults: {
twitter: {type:"twitter-credentials",required:true},
tags: {value:"",validate:function(v) { return this.user == "dm" || v.length > 0;}},
tags: {value:""},
user: {value:"false",required:true},
name: {value:""},
topic: {value:"tweets"}
@@ -184,6 +184,16 @@
});
$("#node-input-user").change();
},
oneditsave: function() {
if ($('#node-input-tags').val() == '' && $("#node-input-user option:selected").val() != 'dm'
&& $("#node-input-user option:selected").val() != 'user') {
this.inputs=1;
}
else {
//set back the default state of 0 inputs
this.inputs=0;
}
}
});
</script>