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 :: find drive D windows sub system linuc 
Shell :: ssh copy id to remote sever 
Shell :: net book value calculator 
Shell :: crosh hacking commands 
Shell :: disable huge pages on Linux xmrig 
Shell :: crate db helm 
Shell :: how to edit etc/hosts linux error readonly e45 
Shell :: como descargar asobe xd en ubutnu 
Shell :: kubectl delete pods wildcard 
Shell :: how to acess folder with space in name in terminal 
Shell :: psexec connection command 
Shell :: linux aarch64 arm none eabi cross compiler ubuntu 
Shell :: bash linux no ouput from command 
Shell :: install mlens 
Shell :: install lib atk 
Shell :: Some nodejs packages not installing on aws instance 
Shell :: why showing different +++++++++------ count git diff command 
Shell :: install symfony cli 
Shell :: create new repository 
Shell :: create git 
Shell :: install openjdk debian 
Shell :: audiokit pod 
Shell :: debian logrotate mail.log monatly 
Shell :: formatear usb desde terminal linux 
Shell :: add individual file to staging area in git command 
Shell :: There are not enough slots available in the system to satisfy the 5 slots that were requested by the application 
Shell :: install kismet for raspberry pi 
Shell :: redirect batch file output 
Shell :: pop os headphones stopped working 
Shell :: salt master hot switch debug 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =