Socket
Socket
Sign inDemoInstall

tools-for-instagram

Package Overview
Dependencies
204
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tools-for-instagram

Tools for instagram


Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Tools-for-Instagram

Snyk Vulnerabilities for npm package NPM npm

Automation scripts for Instagram

View changes

How to use it

Easy way:

1. npm install tools-for-instagram
2. create a .env file on the main directory with this fields:
IG_USERNAME=myUsername
IG_PASSWORD=myPassword

# Uncomment next line to use a proxy
# IG_PROXY=http://proxyuser:proxypassword@xxx.xxx.xxx.xxx:xxxxx
# Uncomment next line to use email verifications | sms by default
# IG_VERIFICATION=email
3. Copy the example.js on the root folder of your project from the repo
4. Execute'node example.js' to test the scripts.
Following steps:
1. Write your automation bots or copy the existent ones inside Tools-for-Instagram module 
(Recommended to create a 'bots' folder in root of the project)
2. Tests the bot using 'node bots/yourBot.js'

Git way:

1. Download the repo and install dependencies using this terminal commands:
    git clone https://github.com/linkfy/Tools-for-Instagram.git
    cd Tools-for-Instagram
    npm install
2. Rename .env_example to .env and edit the configuration.
3. Execute 'node example.js' to test the scripts.
Following steps:
1. Write your automation bots inside bots folder or use the existent ones
2. Tests the bot using 'node bots/bot.js'

Bot skills:

  • Login Flow
  • SMS/Email verification modes
  • Save Cookies in files
  • Remove Cookies
  • Get User Information
  • Get User Recent Posts
  • Get recent post Likers / By Username
  • Get Followers of account (save into a json file)
  • Get Followings of account (save into a json file)
  • Read Following/Followers files generated and return Array.
  • Like Content by URL
  • Like Content by MediaId
  • Like Content by Post
  • Follow by Username
  • Follow User by Post
  • Unfollow by Username
  • View stories by User Id
  • View stories by Username
  • Get recent posts list of a hashtag
  • Get top posts list of a hashtag
  • Get recent post list by location
  • Get top post list by location
  • Save post list into scrape list
  • Implement lowdb Database
  • Save Likes information
  • Save Follows information
  • Save Unfollows information
  • Get Like activity
  • Get Follow activity
  • Get Unfollow activity
  • Current Time In Range Validator [ex: from 8:00 to 23:00]
  • Proxies
  • Multi-login
  • Like Recent Hashtags By Intervals
  • Follow Recent Hashtags By Intervals
  • Simple Bot
  • NPM package support
  • View Stories from User Id/Ids
  • View Stories from User Followers
  • View Stories from User Following
  • Live Streaming
  • Postprocessing of scrape list (detect faces, language, business accounts)

Wiki

https://github.com/linkfy/Tools-for-Instagram/wiki

Follow the project

You can follow the streams of the project on the Twitch channel
https://www.twitch.tv/mimi_twitchbot

Follow the development status

Follow the development status to see what's the next upcoming idea
https://trello.com/b/ZlwRr6l0/tools-for-instagram

Api mods

  • Injected loggedInUser inside ig Object after login (ig.loggedInUser)
  • Injected db inside ig Object after login (ig.db)
  • Injected shortid generator inside ig Object

Api

Basic example

Using npm package
require("tools-for-instagram");

(async () => {

    let ig = await login();

    // .. Implement your code here
    let info = await getUserInfo(ig, "Instagram");
    console.log("User information, username: " + info.username);
    
    // ..
})();
Using Git repo:
require('./src/tools-for-instagram');

(async () => {
    let ig = await login();
    
    // .. Implement your code here
    let info = await getUserInfo(ig, "Instagram");
    console.log("User information, username: " + info.username);
    
    // ..

})();
loadConfig(loginFileName)

Load a config file from the logins folder

By default it will use the proxy from .env file if the proxy is not set on login().

    let acc = loadConfig('exampleAccount');
    let myAccount2 = await login(acc.account, acc.password, acc.proxy);
    //same as await login("username", "password");

To avoid the default proxy from the .env file use false as a third parameter on login:

    let acc = loadConfig('exampleAccount');
    let myAccount2 = await login(acc.account, acc.password, false);

getUserInfo(ig, username)

Get the user information of the desired username

   let info = await getUserInfo(ig, 'Instagram');
getRecentPostLikers(ig, post);

Get the last likers (max of 1000) of a post

    let posts = await getUserRecentPosts(ig, username);
    let likers = await getRecentPostLikers(ig, posts[0]);
getRecentPostLikersByUsername(ig, username)

Get the last likers (max of 1000) of the last post of the desired username

let likers = await getRecentPostLikersByUsername(ig,'instagram');
//Show the last liker of the array
console.log(likers[likers.length-1]);
getFollowers(ig, username)

It will save the followers inside the outputfolder with the format "acountName_followers.json"

   await getFollowers(ig, 'Instagram');
getFollowing(ig, username)

It will save the following inside the outputfolder with the format "acountName_following.json"

   await getFollowing(ig, 'Instagram');
readFollowers(ig, username)

It will return the followers inside the outputfolder with the format "acountName_followers.json"

   let followers = await readFollowers(ig, 'Instagram');
readFollowing(ig, username)

It will return the following inside the outputfolder with the format "acountName_following.json"

   let followers = await readFollowing(ig, 'Instagram');
likeUrl(ig, username, [force: bool])

like the desired instagram Url, the like will be saved inside database.

   await likeUrl(ig, 'https://www.instagram.com/p/B1gzzVpA462/');

If 'force' is set to true, when the item was already liked before it will force to continue the operation.

   await likeUrl(ig, 'https://www.instagram.com/p/B1gzzVpA462/', true);
viewStoriesFromUser(ig, username)

View all the current stories of the given username

   await viewStoriesFromUser(ig, 'instagram');
isTimeInRange(startTime, endTime)

Returns True or False if the current time is inside the range

   await isTimeInRange("10:00", "23:00");

It is also possible to calculate night ranges between the current day and tomorrow.

   await isTimeInRange("23:00", "3:00");
likeRecentHashtagsByIntervals(ig, hashtagArray, intervals, likesPerInterval, waitMinutesBetweenLikes)

Automate like actions on given array of recent hashtags feed

    let likesPerInterval = 15;
    let waitMinutesBetweenLikes = 3;

    let intervals = [
        ["7:00",    "8:00"],
        ["10:00",   "11:00"],
        ["22:00",   "23:00"],
    ];
    let hashtagArray = [
        "cats",
        "dogs",
        "music"
    ];

   let likeInterval = likeRecentHashtagsByIntervals(
                                                    ig,
                                                    hashtagArray, 
                                                    intervals, 
                                                    likesPerInterval,
                                                    waitMinutesBetweenLikes);

It is also possible to stop the interval clearing it

   clearInterval(likeInterval);

This documentation is not yet finished...

recentHashtagList(ig, hashtag)
topHashtagList(ig, hashtag)
likePost(ig, post)
recentLocationList(ig, location, [randomize: bool])
topLocationList(ig, location, [randomize: bool])
savePosts(ig, posts, filename)
followUser(ig, username)
followUserByPost(ig. post)
getLikeActivityByHours(ig, startingHour)
getFollowActivityByHours(ig, startingHour)
getUnfollowActivityByHours(ig, startingHour)
getLikeActivityFromHourToNow(ig, "12:05")
lastLikeMinutesAgo(ig)
removeCookie(ig)
followRecentHashtagsByIntervals(ig, hashtagArray, intervals, followsPerInterval, waitMinutesBetweenFollows)
viewStoriesFromId(ig, userId)
viewStoriesFromFollowing(ig, username)
viewStoriesFromFollowers(ig, username)
getUserRecentPosts(ig, username)
requestLivestream(ig)

Keywords

FAQs

Last updated on 23 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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