Lightweight library service that can dynamically make periodic updates to an Instagram profile.

Overview

instagram-dynamic-profile library

logo

npm npm


This library uses the instagram-private-api to automate dynamic updates to an Instagram profile such as cycling through profile pictures every 30 seconds.

Note: the default refresh interval is set to 30000ms (30 seconds) for most dynamic tasks. If this interval is set below 20 seconds, there is a chance Instagrams API will block requests if more than 200 are made within an hour.


Table of Contents

Install

From npm

npm install instagram-dynamic-profile

From github

npm install github:noodleofdeath/instagram-dynamic-profile

This package uses url-regex-safe (GitHub) to check for links when sending direct messages. By default, the safe regex engine re2 is not installed. It's highly recommended for you to install re2 by running npm install re2, else you will be vulnerable to CVE-2020-7661.

Examples

You can find usage examples here.

Be sure to create a .env file in your project root with your Instagram credentials and match the format of .env.example. In most cases you will also need to run the following inside the project/example directory.

npm i dotenv

Note for JavaScript users: As of Node v.13.5.0, there isn't support for ESModules and the 'import'-syntax. So you have to read the imports in the examples like this:

import { A } from 'b' const { A } = require('b')

Cycling Profile Picture

// Import modules
import 'dotenv/config';
import { resolve } from 'path';
import { IgDPCycleProfilePictureTask, IgDPSession } from 'instagram-dynamic-profile';

// Cycle profile picture with images found in `./img` every 30 seconds.
const session = new IgDPSession({
  username: process.env.IG_USERNAME as string,
  password: process.env.IG_PASSWORD as string,
  tasks: [new IgDPCycleProfilePictureTask(resolve('./img'))],
});

session.start();

Cycling Biography

// Import modules
import 'dotenv/config';
import { IgDPCycleBioTask, IgDPSession } from 'instagram-dynamic-profile';

// Dynamically update the profile bio  every 30 seconds to have the most recent
// timestamp in the last 30 seconds.
const session = new IgDPSession({
  username: process.env.IG_USERNAME as string,
  password: process.env.IG_PASSWORD as string,
  tasks: [
    new IgDPCycleBioTask((): string => {
      return `Today's timestamp is:\n${new Date()}`;
    }),
  ],
});

session.start();

Debugging

In order to get debug infos provided by the library, you can enable debugging. The prefix for this library is ig. To get all debug logs (recommended) set the namespace to ig:*.

Node

In Node you only have to set the environment variable DEBUG to the desired namespace. Further information

Contribution

If you need features that is not implemented - feel free to implement and create PRs!

Plus we need some documentation, so if you are good in it - you are welcome.

Setting up your environment is described here.

Useful links

instagram-id-to-url-segment - convert the image url fragment to the media ID

Support us

If you find this library useful for you, you can support it by donating any amount

BTC: 3HNXnygb1HowTBbvhQrQ4vxekfQ2UM83sd

SHIB: 0xBb8f7EbF3D7f54BAcadece3dada9ab2358C90635

ETH: 0xec78f794489D511137770Ae144A550B50c2AFF92

You might also like...

Simple shopping cart prototype which shows how React components and Redux can be used to build a friendly user experience with instant visual updates and scalable code in e-commerce applications.

Simple shopping cart prototype which shows how React components and Redux can be used to build a friendly user experience with instant visual updates and scalable code in e-commerce applications.

This simple shopping cart prototype shows how React components and Redux can be used to build a friendly user experience with instant visual updates a

Feb 8, 2022

This Application provides basic authentication features like you can register and create account and then login and access your profile.

  This Application provides basic authentication features like you can register and create account and then login and access your profile.

Authentication API This Application provides basic authentication features like you can register and create account and then login and access your pro

Jan 17, 2022

A Web application that showcases Rockets and Missions from the SpaceX API, you can reserve Rockets and join Missions to your profile.

A Web application that showcases Rockets and Missions from the SpaceX API, you can reserve Rockets and join Missions to your profile.

Space Travelers' Hub Project that showcases Rockets and missions from the SpaceX API, the user can reserve Rockets and join Missions, and save them in

Apr 17, 2022

A social network where you can share posts, view your profile metrics and follow other users.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Aug 21, 2022

CSS library for Instagram filters

CSS library for Instagram filters

CSSgram CSSGram is an Instagram filter library written in Sass and CSS. What is This? Simply put, CSSgram is a library for editing your images with In

Jan 4, 2023

RESTful service to provide API linting as-a-service

API Linting Service Prerequisites / general idea General idea behind this API implementation is to provide an API as a service based on the awesome sp

Mar 14, 2022

TypeScript plugin for service-to-service (aka. "functionless") cloud integrations.

Functionless λ Functionless is a TypeScript plugin that transforms TypeScript code into Service-to-Service (aka. "functionless") integrations, such a

Jan 2, 2023

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Dec 28, 2022
Comments
  • 429 Error - Too Many Requests

    429 Error - Too Many Requests

    Making an API request every 30 seconds is still too frequent, and will cause the Instagram API to block the IP of the process making the request after a while. Systematic tests/research will need to be conducted to determine the appropriate refresh rate to use for making periodic requests that will not get the IP address (temporarily) blocked, as well as identify the minimum rate that could potentially get an account banned.

    How to contribute

    NOTE: Please run your tests on a FAKE Instagram account so you do not get your personal account(s) banned.

    Please report your findings on this thread, by copy pasting the output of the following command after a timeout has occurred, or if no timeout error occurs, please report the acceptable interval you were able to use without getting blocked.

    In terminal:

    $ mkdir ~/sbb-tests
    $ cd ~/sbb-tests
    $ git clone https://github.com/noodleofdeath/social-bio-bot
    $ cd social-bio-bot
    $ npm install
    $ echo "IG_USERNAME=your-instagram-username" > .env
    $ echo "IG_PASSWORD=your-instagram-password" >> .env
    $ cat .env
    IG_USERNAME=your-instagram-username
    IG_PASSWORD=your-instagram-password
    $ ./sbiobot.ts ig cycle-bio
    
    opened by NoodleOfDeath 0
Owner
null
Instagram.css - Complete set of Instagram filters in pure CSS

Instagram.css Instagram.css - Pure CSS Instagram filters. You can add all these Instagram-like filters to your photos with using CSS only. Thanks to t

Yan Zhu 4k Dec 30, 2022
Vanilla JavaScript Instagram Feed without access token. Not using the Instagram API

⚠️ This repository has been archived ⚠️ The focus of this repository was to provide an easy and ready to use plugin to display an Instagram Feed but s

Javier Sanahuja 316 Nov 22, 2022
Lavanstax project - Makes it easy and fun to use İnstagram. Also first userbot for İnstagram

Lavanstax Lavanstax project - Makes it easy and fun to use İnstagram. Also first userbot for İnstagram | İnstagram | Telegram Channel | Telegram Group

Berathan Yedibela 19 Oct 15, 2022
🎨 Beautify your github profile with this amazing tool, creating the readme your way in a simple and fast way 🚀 The best profile readme generator you will find ⚡

Demo Profile Readme Generator The best profile readme generator you will find! About | Technologies | Requirements | Starting | Contributing ?? About

Mauro de Souza 476 Jan 1, 2023
This site compares your GitHub Profile to your friends, and analyses and tells your GitHub profile score too.

GitHub ⚔️ Duel Deployed at ?? : https://githubduel.vercel.app/ Compare your GitHub profiles with your friends It gives score to GitHub profile based o

Anshuman swain 17 Nov 21, 2022
A public board for all the Computer Society and Students to display their profile. An online year-book for you to display your profile in the most creative manner

Student's Yearbook by IEEE Computer Society Student's yearbook is an open-source project which intends to dispaly the students who will be graduating

IEEE Computer Society 11 Dec 18, 2022
✨ Bot that can check your Friendship on Instagram

Instagram Friendship Checker Bot that can check your friendship on Instagram. It can told you who are your mutual, your following who don't follow you

Gading Nasution 12 Dec 21, 2022
Fallback JS - JavaScript library for dynamically loading CSS and JS files

Fallback JS - JavaScript library for dynamically loading CSS and JS files. Also provides the ability to load multiple files from a CDN with multiple fallback options and shimming!

Dolox Inc. 311 Nov 13, 2022