Allow twitter out node to specify extra parameters

to close #119. Thanks @sacbhale
This commit is contained in:
Dave Conway-Jones 2015-09-04 09:20:37 +01:00
parent 059c7a2d67
commit d782a5afb6
4 changed files with 7 additions and 2 deletions

View File

@ -205,6 +205,8 @@
<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 an object of name: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:"twitter.status.failed"});
node.error(err,msg);

View File

@ -54,3 +54,5 @@ To send a Direct Message (DM) - use a payload like.
D {username} {message}
If **msg.media** exists and is a Buffer object, this node will treat it as an image and attach it to the tweet.
If **msg.params** exists and is an object of name:value pairs, this node will treat it as parameters for the update request.

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-twitter",
"version" : "0.1.1",
"version" : "0.1.2",
"description" : "A Node-RED node to talk to Twitter",
"dependencies" : {
"twitter-ng": "0.6.2",