├── .gitignore ├── .gitattributes ├── .travis.yml ├── .editorconfig ├── test.js ├── license ├── package.json ├── readme.md └── cli.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.js text eol=lf 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '8' 4 | - '6' 5 | - '4' 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import childProcess from 'child_process'; 2 | import test from 'ava'; 3 | 4 | test.cb('user()', t => { 5 | const cp = childProcess.spawn('./cli.js', ['iama_rishi'], {stdio: 'inherit'}); 6 | 7 | cp.on('error', t.ifError); 8 | 9 | cp.on('close', code => { 10 | t.is(code, 0); 11 | t.end(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Rishi Giri (rishigiri.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "istalk", 3 | "version": "1.0.6", 4 | "description": "Don't pollute your browser history. Stalk instagram users from the command line!", 5 | "main": "cli.js", 6 | "bin": { 7 | "stalk": "cli.js" 8 | }, 9 | "engines": { 10 | "node": ">=4" 11 | }, 12 | "scripts": { 13 | "test": "xo && ava" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/CodeDotJS/istalk.git" 18 | }, 19 | "keywords": [ 20 | "stalk", 21 | "instagram", 22 | "user", 23 | "username", 24 | "biography", 25 | "followers", 26 | "following" 27 | ], 28 | "dependencies": { 29 | "chalk": "^2.0.1", 30 | "fs-extra": "^4.0.0", 31 | "got": "^6.3.0", 32 | "log-update": "^2.0.0", 33 | "ora": "^1.3.0", 34 | "unicodechar-string": "^1.0.0", 35 | "update-notifier": "^2.2.0" 36 | }, 37 | "devDependencies": { 38 | "ava": "^0.15.0", 39 | "xo": "^0.16.0" 40 | }, 41 | "xo": { 42 | "esnext": true 43 | }, 44 | "author": "Rishi Giri (http://rishigiri.com)", 45 | "license": "MIT", 46 | "bugs": { 47 | "url": "https://github.com/CodeDotJS/istalk/issues" 48 | }, 49 | "homepage": "https://github.com/CodeDotJS/istalk#readme" 50 | } 51 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 |
3 | 4 |
5 | 6 |
7 |

8 | 9 |

Don't pollute your browser history. Stalk instagram users from the command line!

10 | 11 | ## Install 12 | 13 | ``` 14 | $ npm install --global istalk 15 | ``` 16 | 17 | ## Preview 18 | 19 |

20 | 21 | ## Usage 22 | ``` 23 | Usage: stalk 24 | 25 | Commands: 26 | -h, --help Display help 27 | 28 | Help: 29 | $ stalk 9gag 30 | 31 | You can also use: 32 | 33 | › instavim : complete instagram media downloader 34 | › instafy : new instagram post notifications from command line 35 | ``` 36 | 37 | __`Why?`__ 38 | 39 | - Because why not? If you like wasting time, try to waste it without wasting too much time! 40 | 41 | ## Related 42 | 43 | - __[`instavim`](https://https://github.com/CodeDotJS/instavim)__ `:` `A complete instagram media downloader` 44 | - __[`instagram-id-of`](https://github.com/CodeDotJS/instagram-id-of)__ `:` `Easily find user id of any instagram user from the command line` 45 | - __[`instagram-profile-picture`](https://github.com/CodeDotJS/instagram-profile-picture)__ `:` `Get url to the profile picture of any instagram user in different resolutions` 46 | - __[`instagram-links`](https://github.com/CodeDotJS/Instagram-links)__ `:` `Get links to the publicly shared media on Instagram` 47 | - __[`basic-instagram-user-details`](https://github.com/CodeDotJS/basic-instagram-user-details)__ `:` `A simple API to scrap basic details of an instagram user` 48 | - __[`instafy`](https://https://github.com/CodeDotJS/instafy)__ `:` `Instagram post notifications from the command line` 49 | 50 | ## License 51 | 52 | MIT © [Rishi Giri](http://rishigiri.ml) 53 | -------------------------------------------------------------------------------- /cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const dns = require('dns'); 6 | const got = require('got'); 7 | const chalk = require('chalk'); 8 | const ora = require('ora'); 9 | const logUpdate = require('log-update'); 10 | const updateNotifier = require('update-notifier'); 11 | const strip = require('unicodechar-string'); 12 | const pkg = require('./package.json'); 13 | 14 | updateNotifier({pkg}).notify(); 15 | 16 | const arg = process.argv[2]; 17 | const pre = chalk.cyan.bold('›'); 18 | const pos = chalk.red.bold('›'); 19 | const profile = `https://www.instagram.com/${arg}`; 20 | const spinner = ora(); 21 | 22 | if (arg === '-h' || arg === '--help') { 23 | console.log(` 24 | Usage: stalk 25 | 26 | Commands: 27 | -h, ${chalk.dim('--help')} Display help 28 | 29 | Help: 30 | $ stalk 9gag 31 | 32 | You can also use: 33 | 34 | ${pre} ${chalk.dim('instavim : complete instagram media downloader')} 35 | ${pre} ${chalk.dim('instafy : new instagram post notifications from command line')} 36 | 37 | Don't pollute your browser history. Do things from the command line. 38 | `); 39 | process.exit(1); 40 | } 41 | 42 | if (!arg) { 43 | logUpdate(`\n${pos} Username required! \n\n ${chalk.dim('$ stalk -h or --help for more help')}\n`); 44 | process.exit(1); 45 | } 46 | 47 | dns.lookup('instagram.com', err => { 48 | if (err) { 49 | logUpdate(`\n${pos} Please check your Internet Connection! \n`); 50 | } else { 51 | logUpdate(); 52 | spinner.text = 'Hold your breath, sucker!'; 53 | spinner.start(); 54 | 55 | got(profile).then(res => { 56 | let message = ''; 57 | const privacy = res.body.split('"is_private":')[1].split(',"')[0] === 'false' ? 'Public' : 'Private'; 58 | const usr = res.body.split('"external_url":')[1].split(',"')[0] === 'null' ? message += chalk.red('no external url found') : message += res.body.split('"external_url":"')[1].split('","')[0]; 59 | 60 | logUpdate(` 61 | ${pre} Full Name : ${strip(res.body.split('full_name":"')[1].split('","')[0]) || chalk.red(`${arg}'s full name is not available!`)} 62 | 63 | ${pre} Profile : ${privacy} 64 | 65 | ${pre} Posts : ${res.body.split(',"edge_owner_to_timeline_media":{"count":')[1].split(',"')[0]} 66 | 67 | ${pre} Biography : ${strip(res.body.split('"biography":"')[1].split('","')[0]) || `${chalk.red('no biography found')}`} 68 | 69 | ${pre} Followers : ${res.body.split(',"edge_followed_by":{"count":')[1].split('},"')[0]} 70 | 71 | ${pre} Following : ${res.body.split(',"edge_follow":{"count":')[1].split('},"')[0]} 72 | 73 | ${pre} External link : ${usr} 74 | `); 75 | spinner.stop(); 76 | }).catch(err => { 77 | if (err) { 78 | logUpdate(`\n${pos} ${arg} is not an Instagram user! \n`); 79 | process.exit(1); 80 | } 81 | }); 82 | } 83 | }); 84 | --------------------------------------------------------------------------------