added msg.params as an option for twitter out node

This commit is contained in:
sacbhale 2015-06-30 05:04:20 +00:00
parent fd4b319af9
commit 1557a46fa9
2 changed files with 5 additions and 1 deletions

View File

@ -204,6 +204,9 @@
<p>To send a Direct Message (DM) - use a payload like "D {username} {message}"</p>
<p>If <b>msg.media</b> exists and is a Buffer object, this node will treat it
as an image and attach it to the tweet.</p>
<p>If <b>msg.params</b> exists and is a set of field: value pairs, this node will treat it as
parameters for the update request</p>
</script>
<script type="text/javascript">

View File

@ -313,7 +313,8 @@ module.exports = function(RED) {
form.append("media[]",msg.media,{filename:"image"});
} else {
twit.updateStatus(msg.payload, function (err, data) {
if (typeof msg.params === 'undefined') { msg.params = {};}
twit.updateStatus(msg.payload, msg.params, function (err, data) {
if (err) {
node.status({fill:"red",shape:"ring",text:RED._("twitter.status.failed")});
node.error(err,msg);