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">
<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>
<input type="hidden" id="node-config-input-screen_name">
</script>
@ -79,6 +82,9 @@
</script>
<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">
<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">
@ -93,6 +99,10 @@
<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&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">
<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">
@ -181,6 +191,7 @@
$("#node-input-tags-label").html(forlabel);
$("#node-input-tags").attr("placeholder",forph);
}
$("#tweet-events-deprecated").toggle((type === 'event'));
});
$("#node-input-user").change();
},
@ -198,6 +209,9 @@
<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">
<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">

View File

@ -47,6 +47,7 @@ module.exports = function(RED) {
function TwitterInNode(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.user = n.user;
//this.tags = n.tags.replace(/ /g,'');
@ -56,6 +57,8 @@ module.exports = function(RED) {
this.twitterConfig = RED.nodes.getNode(this.twitter);
var credentials = RED.nodes.getCredentials(this.twitter);
var node = this;
if (credentials && credentials.screen_name == this.twitterConfig.screen_name) {
var twit = new Ntwitter({
consumer_key: "OKjYEd1ef2bfFolV25G5nQ",
@ -71,7 +74,6 @@ module.exports = function(RED) {
//
//},10000);
var node = this;
if (this.user === "user") {
node.poll_ids = [];
node.since_ids = {};
@ -179,6 +181,7 @@ module.exports = function(RED) {
});
}
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 {
var thingu = 'user';
var setupEvStream = function() {
@ -381,6 +384,7 @@ module.exports = function(RED) {
function TwitterOutNode(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.twitter = n.twitter;
this.twitterConfig = RED.nodes.getNode(this.twitter);

View File

@ -20,7 +20,7 @@
"follow": "all tweets from people I follow",
"user": "the tweets of specific users",
"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.",
"status": {

View File

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

View File

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