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

Add deprecation warnings to twitter node

This commit is contained in:
Nick O'Leary 2018-05-25 13:16:34 +01:00
parent 6ebe49cd70
commit 38e469464f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
5 changed files with 22 additions and 4 deletions

View File

@ -1,5 +1,8 @@
<script type="text/x-red" data-template-name="twitter-credentials"> <script type="text/x-red" data-template-name="twitter-credentials">
<div class="form-tips" style="background: #edd; padding: 20px; margin-bottom: 20px">
<i class="fa fa-warning"></i> This version of the Twitter node will no longer be able to connect to the Twitter API from June 12th 2018. See <a href="https://bit.ly/2kr7InE">here</a> for details.
</div>
<div class="form-row" id="node-config-twitter-row"></div> <div class="form-row" id="node-config-twitter-row"></div>
<input type="hidden" id="node-config-input-screen_name"> <input type="hidden" id="node-config-input-screen_name">
</script> </script>
@ -79,6 +82,9 @@
</script> </script>
<script type="text/x-red" data-template-name="twitter in"> <script type="text/x-red" data-template-name="twitter in">
<div class="form-tips" style="background: #edd; padding: 20px; margin-bottom: 20px">
<i class="fa fa-warning"></i> This version of the Twitter node will no longer be able to connect to the Twitter API from June 12th 2018. See <a href="https://bit.ly/2kr7InE">here</a> for details.
</div>
<div class="form-row"> <div class="form-row">
<label for="node-input-twitter"><i class="fa fa-user"></i> <span data-i18n="twitter.label.twitter-id"></span></label> <label for="node-input-twitter"><i class="fa fa-user"></i> <span data-i18n="twitter.label.twitter-id"></span></label>
<input type="text" id="node-input-twitter"> <input type="text" id="node-input-twitter">
@ -93,6 +99,10 @@
<option value="event" data-i18n="twitter.search.events"></option> <option value="event" data-i18n="twitter.search.events"></option>
</select> </select>
</div> </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&apos;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"> <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> <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"> <input type="text" id="node-input-tags" data-i18n="[placeholder]twitter.placeholder.for">
@ -181,6 +191,7 @@
$("#node-input-tags-label").html(forlabel); $("#node-input-tags-label").html(forlabel);
$("#node-input-tags").attr("placeholder",forph); $("#node-input-tags").attr("placeholder",forph);
} }
$("#tweet-events-deprecated").toggle((type === 'event'));
}); });
$("#node-input-user").change(); $("#node-input-user").change();
}, },
@ -198,6 +209,9 @@
<script type="text/x-red" data-template-name="twitter out"> <script type="text/x-red" data-template-name="twitter out">
<div class="form-tips" style="background: #edd; padding: 20px; margin-bottom: 20px">
<i class="fa fa-warning"></i> This version of the Twitter node will no longer be able to connect to the Twitter API from June 12th 2018. See <a href="https://bit.ly/2kr7InE">here</a> for details.
</div>
<div class="form-row"> <div class="form-row">
<label for="node-input-twitter"><i class="fa fa-user"></i> <span data-i18n="twitter.label.twitter-id"></span></label> <label for="node-input-twitter"><i class="fa fa-user"></i> <span data-i18n="twitter.label.twitter-id"></span></label>
<input type="text" id="node-input-twitter"> <input type="text" id="node-input-twitter">

View File

@ -47,6 +47,7 @@ module.exports = function(RED) {
function TwitterInNode(n) { function TwitterInNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.error("This version of the Twitter node will no longer be able to connect to the Twitter API from June 12th 2018. See https://bit.ly/2kr7InE for details.")
this.active = true; this.active = true;
this.user = n.user; this.user = n.user;
//this.tags = n.tags.replace(/ /g,''); //this.tags = n.tags.replace(/ /g,'');
@ -56,6 +57,8 @@ module.exports = function(RED) {
this.twitterConfig = RED.nodes.getNode(this.twitter); this.twitterConfig = RED.nodes.getNode(this.twitter);
var credentials = RED.nodes.getCredentials(this.twitter); var credentials = RED.nodes.getCredentials(this.twitter);
var node = this;
if (credentials && credentials.screen_name == this.twitterConfig.screen_name) { if (credentials && credentials.screen_name == this.twitterConfig.screen_name) {
var twit = new Ntwitter({ var twit = new Ntwitter({
consumer_key: "OKjYEd1ef2bfFolV25G5nQ", consumer_key: "OKjYEd1ef2bfFolV25G5nQ",
@ -71,7 +74,6 @@ module.exports = function(RED) {
// //
//},10000); //},10000);
var node = this;
if (this.user === "user") { if (this.user === "user") {
node.poll_ids = []; node.poll_ids = [];
node.since_ids = {}; node.since_ids = {};
@ -179,6 +181,7 @@ module.exports = function(RED) {
}); });
} }
else if (this.user === "event") { else if (this.user === "event") {
this.error("This Twitter node is configured to access a user's activity stream. Twitter are withdrawing this API in August 2018 so this feature will be removed from the node in the near future. See https://bit.ly/2kr7InE for details.")
try { try {
var thingu = 'user'; var thingu = 'user';
var setupEvStream = function() { var setupEvStream = function() {
@ -381,6 +384,7 @@ module.exports = function(RED) {
function TwitterOutNode(n) { function TwitterOutNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.error("This version of the Twitter node will no longer be able to connect to the Twitter API from June 12th 2018. See https://bit.ly/2kr7InE for details.")
this.topic = n.topic; this.topic = n.topic;
this.twitter = n.twitter; this.twitter = n.twitter;
this.twitterConfig = RED.nodes.getNode(this.twitter); this.twitterConfig = RED.nodes.getNode(this.twitter);

View File

@ -20,7 +20,7 @@
"follow": "all tweets from people I follow", "follow": "all tweets from people I follow",
"user": "the tweets of specific users", "user": "the tweets of specific users",
"direct": "your direct messages", "direct": "your direct messages",
"events": "your twitter events" "events": "*deprecated* your twitter events"
}, },
"tip": "Tip: Use commas without spaces between multiple search terms. Comma = OR, Space = AND.<br/>The Twitter API WILL NOT deliver 100% of all tweets.<br/>Tweets of who you follow will include their retweets and favourites.<br/><br/>Leave <b>for</b> blank to set using msg.payload.", "tip": "Tip: Use commas without spaces between multiple search terms. Comma = OR, Space = AND.<br/>The Twitter API WILL NOT deliver 100% of all tweets.<br/>Tweets of who you follow will include their retweets and favourites.<br/><br/>Leave <b>for</b> blank to set using msg.payload.",
"status": { "status": {

View File

@ -20,7 +20,7 @@
"follow": "フォローしているユーザの全てのツイート", "follow": "フォローしているユーザの全てのツイート",
"user": "特定ユーザのツイート", "user": "特定ユーザのツイート",
"direct": "ダイレクトメッセージ", "direct": "ダイレクトメッセージ",
"events": "自身のイベント" "events": "*deprecated* 自身のイベント"
}, },
"tip": "注釈: 複数の検索条件を指定する場合は、空白のないコンマで区切り入力してください。コンマはOR条件、空白はAND条件となります。<br/>Twitter APIは全てのツイートを取得できないことがあります。<br/>「フォローしているユーザの全てのツイート」には、リツイートやいいねが含まれます。<br/><br/>msg.payloadに検索条件を指定する場合は <b>「検索条件」</b> を空欄にしてください。", "tip": "注釈: 複数の検索条件を指定する場合は、空白のないコンマで区切り入力してください。コンマはOR条件、空白はAND条件となります。<br/>Twitter APIは全てのツイートを取得できないことがあります。<br/>「フォローしているユーザの全てのツイート」には、リツイートやいいねが含まれます。<br/><br/>msg.payloadに検索条件を指定する場合は <b>「検索条件」</b> を空欄にしてください。",
"status": { "status": {

View File

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