Giter VIP home page Giter VIP logo

instalite's Introduction

INSTAGRAM API InstaLite License

easy-to-use class for working with instagram, minimal number of features

Downloads Telegram

Installation

Using Composer:

composer require tioffs/instalite

Example

require_once __DIR__ . '/vendor/autoload.php';
use InstaLite\InstaLite;
$instagram = new InstaLite("username", "password", "proxy");
/** search user (return array standart instagram) **/
$user = $instagram->searchUser('alex')->id();
/** search user (return array user id [1,2,3]) **/
$user = $instagram->searchUser('alex')->all();
/** send photo **/
$instagram->uploadPhoto(__DIR__ . '/img.jpg', 'text #hashtag');
/** send message direct **/
$instagram->sendMessage('text message', [1233, 1233, 1223]);

Method

Search User

Search user instagram, nickname, username, last name, first name

$key = "search first name or username ...";
$user = $instagram->searchUser($key);
 
$user->id();
/** return array user id **/
[1, 2, 3, 4, 5, 6]

$user->all();
/** return array user standart formate instagram **/
[
    [
        pk: ""
        username: ""
        full_name: ""
        is_private: false
        profile_pic_url: ""
        profile_pic_id: ""
        is_verified: false
        has_anonymous_profile_picture: false
        mutual_followers_count: 0
        social_context: ""
        search_social_context: ""
        friendship_status: {}
        latest_reel_media: 1580484486
        seen: 0
    ],[],[]
]

Upload Photo

Send photo, upload instagram

/** file photo mimetype JPEG **/
$photo = __DIR__ . '/image.jpg';
/** Message text and Hashtag **/
$message = 'Hello InstaGram';
$upload = $instagram->uploadPhoto($photo, $message);
/** Result **/
if($upload) {
    /** upload photo sussecc **/
    echo $upload;
    /** media id **/
}

Send Message

Send message direct instagram

/** Array user id **/
$user = [12356456, 45645465];
/** Message text **/
$message = 'Hello InstaGram';
$send = $instagram->sendMessage($message, $user);
/** Result **/
if($send) {
    /** message send sussecc **/
}

Use Proxy

supports socks5 and http/https

/** socks5 **/
$instagram = new InstaLite("username", "password", "socks5://login:password@ip:port");
/** http/https **/
$instagram = new InstaLite("username", "password", "http://login:password@ip:port");

Made with โ™ฅ from the @tioffs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.