Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Npm install instagram-private-api

npm install github:dilame/instagram-private-api
Comment

Npm install instagram-private-api

npm install instagram-private-api
Comment

Npm install instagram-private-api

import { IgApiClient } from './index';import { sample } from 'lodash';const ig = new IgApiClient();// You must generate device id's before login.// Id's generated based on seed// So if you pass the same value as first argument - the same id's are generated every timeig.state.generateDevice(process.env.IG_USERNAME);// Optionally you can setup proxy urlig.state.proxyUrl = process.env.IG_PROXY;(async () => {  // Execute all requests prior to authorization in the real Android application  // Not required but recommended  await ig.simulate.preLoginFlow();  const loggedInUser = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);  // The same as preLoginFlow()  // Optionally wrap it to process.nextTick so we dont need to wait ending of this bunch of requests  process.nextTick(async () => await ig.simulate.postLoginFlow());  // Create UserFeed instance to get loggedInUser's posts  const userFeed = ig.feed.user(loggedInUser.pk);  const myPostsFirstPage = await userFeed.items();  // All the feeds are auto-paginated, so you just need to call .items() sequentially to get next page  const myPostsSecondPage = await userFeed.items();  await ig . media . like ( {     // Like our first post from first page or first post from second page randomly    mediaId: sample([myPostsFirstPage[0].id, myPostsSecondPage[0].id]),    moduleInfo: {      module_name: 'profile',      user_id: loggedInUser.pk,      username: loggedInUser.username,    } ,    d: sample([0, 1]),  });})();
Comment

PREVIOUS NEXT
Code Example
Shell :: install chromedriver in jenkins container 
Shell :: Binding to singularity additional volume 
Shell :: how to Login Database Server as the root user 
Shell :: Unable to install libgnutls-dev 
Shell :: heading in github readme 
:: how to take a screenshot of the login or lock screen in ubuntu linux 
Shell :: use bash path variable in vim 
::  
Shell ::  
Shell ::  
:: convert dos to unix vim 
Shell :: sanity coding with basir 
Shell :: Payload retrieve sam and system from a live file system 
Shell ::  
::  
Shell :: yarn gem 
Shell :: how to move a bunch of files into a folder with mv 
:: KDE Connect Command PC turn off 
Shell :: flask shell context processor 
Shell :: android studio avd system image download 
Shell :: column cut linux 
Shell :: barryvdh dompdf file_getcontents passing null 
Shell :: PortableVisibilityConverter 
Shell :: heroku rename remote app 
Shell :: Cloud watch agent for logs and use of PStore 
Shell :: Wallpaper kali 
Shell :: how to transfer data between computers 
Shell :: how to usepyinstaller 
Shell :: http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu focal main 
Shell :: catch grep cat last first lines of a file linux 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =