Socket
Socket
Sign inDemoInstall

node-red-contrib-twitter-follow

Package Overview
Dependencies
49
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

17

nodes/follow/follow.js

@@ -5,2 +5,6 @@ module.exports = (RED) => {

const twitter = require('twitter');
let limitFlag = false; //分間のフォローリミット
setInterval(() => limitFlag = false,1000 * 60);
console.log(`----`)

@@ -14,5 +18,3 @@ console.log(RED);

let twitterconfig;
console.log(`----`)
console.log(node.twitterConfig);
console.log(`----`)
try {

@@ -37,13 +39,16 @@ twitterconfig = require('../../env');

node.on('input', async (msg) => {
const mes = msg.payload;
// const mes = msg.payload;
try {
if(!msg.tweet) throw new Error('Tweetオブジェクトがありません。');
if(limitFlag) throw new Error('分間のリミットです');
console.log(`[${msg.tweet.user.id_str}]${msg.tweet.user.name}さんをフォローしようとしています。`);
await client.post('friendships/create', {user_id: msg.tweet.user.id});
console.log(`${msg.tweet.user.name}さんをフォローしました。`);
console.log(`${msg.tweet.user.name}さんをフォローしました。`);
limitFlag = true;
msg.payload = `${msg.tweet.user.name}さんをフォローしました。`;
} catch (error) {
console.log(error);
msg.payload = error;
}
msg.payload = res.data;
node.send(msg);

@@ -50,0 +55,0 @@ });

{
"name": "node-red-contrib-twitter-follow",
"version": "0.0.4",
"version": "0.0.5",
"description": "Twitter Follow API",

@@ -5,0 +5,0 @@ "main": "twitter.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc