mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
big twitter node update for api changes
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<p>Authentication for the Twitter API</p>
|
||||
<p>Earlier versions of this node provided one-click authentication. Twitter removed the ability
|
||||
to do that in June 2018. You must now register your own application with
|
||||
<a href="https://apps.twitter.com">Twitter</a> and generate your own access tokens.</p>
|
||||
<a href="https://developer.twitter.com/">Twitter</a> and generate your own access tokens.</p>
|
||||
|
||||
</script>
|
||||
|
||||
@@ -96,12 +96,8 @@
|
||||
<option value="true" data-i18n="twitter.search.follow"></option>
|
||||
<option value="user" data-i18n="twitter.search.user"></option>
|
||||
<option value="dm" data-i18n="twitter.search.direct"></option>
|
||||
<option value="event" data-i18n="twitter.search.events"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="tweet-events-deprecated" class="hide form-tips" style="background: #edd; padding: 20px; margin-bottom: 20px">
|
||||
<i class="fa fa-warning"></i> Twitter are withdrawing the API used to access a user's activity stream in August 2018 so this feature will be removed from the node in the near future. See <a href="https://bit.ly/2kr7InE">here</a> for details.
|
||||
</div>
|
||||
<div class="form-row" id="node-input-tags-row">
|
||||
<label for="node-input-tags"><i class="fa fa-tags"></i> <span id="node-input-tags-label" data-i18n="twitter.label.for"></span></label>
|
||||
<input type="text" id="node-input-tags" data-i18n="[placeholder]twitter.placeholder.for">
|
||||
@@ -116,23 +112,28 @@
|
||||
<script type="text/x-red" data-help-name="twitter in">
|
||||
<p>Twitter input node. Can be used to search either:
|
||||
<ul><li>the public stream for tweets containing the configured search term</li>
|
||||
<li>all the tweets from accounts that the authenticated user follows</li>
|
||||
<li>all tweets by specified users</li>
|
||||
<li>tweets from accounts that the authenticated user follows</li>
|
||||
<li>tweets by specified 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.
|
||||
If you want to pass in the search term(s) via the <code>msg.payload</code>, leave the <b>for</b> 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>When returning events it sets the <code>msg.payload</code> to the twitter event, a full list is documented by
|
||||
<a href="https://dev.twitter.com/streaming/overview/messages-types#Events_event" target="_new">Twitter</a>.</p>
|
||||
<p>Sets <code>msg.tweet</code> to the full tweet object as documented by <a href="https://dev.twitter.com/overview/api/tweets" target="_new">Twitter</a>.
|
||||
|
||||
<p><b>Note</b>: This node is not connected to the FireHose, so will not return 100% of all tweets to a busy @id or #hashtag.</p>
|
||||
<p><b>Note:</b> when set to follow specific users, or your direct messages, the node is subject to
|
||||
the rate limiting of the Twitter API. If you deploy the flows multiple times within a 15 minute window, you may
|
||||
exceed the limit and will see errors from the node. These errors will clear automatically when the current 15
|
||||
minute window passes.</p>
|
||||
<h3>Outputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>payload <span class="property-type">string</span></dt>
|
||||
<dd>the text of the tweet</dd>
|
||||
<dt>topic <span class="property-type">string</span></dt>
|
||||
<dd>set to <code>tweets/<i>screen_name</i></code></dd>
|
||||
<dt>tweet <span class="property-type">object</span></dt>
|
||||
<dd>the full tweet object returned by the Twitter API</dd>
|
||||
<dt>location <span class="property-type">object</span></dt>
|
||||
<dd>location information associated with the tweet, if known</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
<p>When searching for multiple terms, use a space for <i>and</i> and comma `,` for <i>or</i>.
|
||||
<p>The full tweet object is documented <a href="https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object" target="_new">here</a>.</p>
|
||||
<p><b>Note:</b> this node is subject to the rate limiting restrictions of the Twitter
|
||||
API. It polls the API once a minute for updates. If you deploy frequently you may
|
||||
exceed the limit. The node will automatically delay polling until the end of the current
|
||||
rate limiting window.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -144,7 +145,6 @@
|
||||
tags: {value:""},
|
||||
user: {value:"false",required:true},
|
||||
name: {value:""},
|
||||
topic: {value:"tweets"},
|
||||
inputs: {value:0}
|
||||
},
|
||||
inputs: 0,
|
||||
@@ -189,7 +189,6 @@
|
||||
$("#node-input-tags-label").html(forlabel);
|
||||
$("#node-input-tags").attr("placeholder",forph);
|
||||
}
|
||||
$("#tweet-events-deprecated").toggle((type === 'event'));
|
||||
});
|
||||
$("#node-input-user").change();
|
||||
},
|
||||
@@ -218,12 +217,24 @@
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="twitter out">
|
||||
<p>Twitter out node. Tweets the <code>msg.payload</code>.</p>
|
||||
<p>To send a Direct Message (DM) - use a payload like "D {username} {message}"</p>
|
||||
<p>If <code>msg.media</code> exists and is a Buffer object, this node will treat it
|
||||
as an image and attach it to the tweet.</p>
|
||||
<p>If <code>msg.params</code> exists and is an object of name:value pairs,
|
||||
this node will treat it as parameters for the update request.</p>
|
||||
<p>Send tweets and direct messages.</p>
|
||||
<h3>Inputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>payload <span class="property-type">string</span></dt>
|
||||
<dd>Sent as the body of the tweet. See below for how to send a Direct Message</dd>
|
||||
<dt class="optional">media <span class="property-type">buffer</span></dt>
|
||||
<dd>A Buffer of an image to attach to the tweet</dd>
|
||||
<dt class="optional">params <span class="property-type">object</span></dt>
|
||||
<dd>Additional parameters to pass to the Twitter status update API.</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
<p>This nodes sends a tweet for the authenticated user. If <code>msg.media</code>
|
||||
is set and contains a Buffer, it is attached as an image.</p>
|
||||
<p>To send a Direct Message, the payload should be formatted as: <code>D {username} {message}</code>.</p>
|
||||
<p>Note that you cannot attach an image to a direct message.</p>
|
||||
<p>If <code>msg.params</code> exists and is an object of name:value pairs, they
|
||||
will be included in the request to the Twitter api. The available values are documented
|
||||
<a href="https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update#parameters" target="_new">here</a>.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
Reference in New Issue
Block a user