All Projects → aik27 → Inwidget

aik27 / Inwidget

Licence: other
inWidget - free Instagram widget for your website. Allows you to show photos from an Instagram account, by hashtags and more.

Projects that are alternatives of or similar to Inwidget

Socialmanagertools Igbot
🤖 📷 Instagram Bot made with love and nodejs
Stars: ✭ 699 (+429.55%)
Mutual labels:  instagram-api, instagram, instagram-scraper
igFame
📷 igFame - Tool for automated Instagram interactions [PHP]
Stars: ✭ 16 (-87.88%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagram Proxy Api
CORS compliant API to access Instagram's public data
Stars: ✭ 245 (+85.61%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Socialmanagertools Docs
📚 Documentation of Social Manager Tools
Stars: ✭ 151 (+14.39%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instagram User Feed
This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
Stars: ✭ 435 (+229.55%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instagram Php Scraper
Get account information, photos, videos, stories and comments.
Stars: ✭ 2,490 (+1786.36%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instauto
Simple to use wrapper around the private Instagram API, written in Python.
Stars: ✭ 52 (-60.61%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instabotai
Instagram AI bot with face detection. It works without instagram api, need only login and password.
Stars: ✭ 181 (+37.12%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instasharper
Private Instagram API
Stars: ✭ 426 (+222.73%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instamancer
Scrape Instagram's API with Puppeteer
Stars: ✭ 273 (+106.82%)
Mutual labels:  instagram-api, instagram, instagram-scraper
nanogram.js
📷 An easy-to-use and simple Instagram package that allows you to fetch media content without API and access token.
Stars: ✭ 62 (-53.03%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagram Scraper
Scrapes an instagram user's photos and videos
Stars: ✭ 5,664 (+4190.91%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Instagram-Scraper-2021
Scrape Instagram content and stories anonymously, using a new technique based on the har file (No Token + No public API).
Stars: ✭ 57 (-56.82%)
Mutual labels:  instagram, instagram-scraper, instagram-api
Instagramapisharp
A complete Private Instagram API for .NET (C#, VB.NET).
Stars: ✭ 486 (+268.18%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Igql
Unofficial Instagram GraphQL API to collet data without authentication
Stars: ✭ 80 (-39.39%)
Mutual labels:  instagram-api, instagram, instagram-scraper
Toolsig
toolsigv3.1 (Instagram Tools)
Stars: ✭ 121 (-8.33%)
Mutual labels:  instagram-api, instagram
Goinsta
Unofficial Instagram API written in Golang
Stars: ✭ 733 (+455.3%)
Mutual labels:  instagram-api, instagram
Instagram Scraper
Scrape the Instagram frontend. Inspired from twitter-scraper by @kennethreitz.
Stars: ✭ 903 (+584.09%)
Mutual labels:  instagram, instagram-scraper
Instagram Api Toolkit
Instagram Private API generator toolkit - A single source of truth for generated SDKs
Stars: ✭ 48 (-63.64%)
Mutual labels:  instagram-api, instagram
Gatsby Source Instagram All
⚛️📸 Gatsby source plugin for fetching all your instagram posts
Stars: ✭ 42 (-68.18%)
Mutual labels:  instagram-api, instagram

inWidget - free Instagram widget for your website

This library is based on PHP and allows you to show photos from an Instagram account on your website.

Demonstration >>

demo

Features:

  • Many settings
  • Direct links to photos
  • Profile stats
  • Adaptive, responsive template
  • Support of several hashtags
  • Language auto detection
  • Works without ACCESS_TOKEN
  • Inserting with one line in HTML
  • Many skins
  • Without advertising
  • For any use
  • Detailed instructions

System requirements

PHP >= 5.4.0 with cURL extension

Installation

1. Upload source code to the root folder of your website

Download source code. Extract /inwidget folder. Upload /inwidget folder to website with all files inside.

Or use composer

composer.phar require aik27/inwidget
composer require aik27/inwidget

Note. inWidget using relative paths, so you can upload it to any folder. After that do not forget change URL in IFRAME tag.

2. Set write permissions to the folder: /inwidget/cache

inWidget will store cached data in /inwidget/cache folder. If this directory does not have write permissions you will see ERROR #101.

3. Configuration

Modify /inwidget/config.php You will need to specify Instagram login and other params

List of parameters:

  • LOGIN - Instagram login
  • HASHTAG - hashtags separated by a comma (for example: girl, man). Selection will be made from around the world in the order that photos were marked with desired tags
  • ACCESS_TOKEN - a hashkey granted to you by an Instagram app. This option is NOT required. If you use it, the widget will start sending requests through the official endpoints API (https://www.instagram.com/developer/). In this case, the widget will have only those rights and limits that the application itself possesses. For more information about, please, use this link: https://inwidget.ru/#token
  • authLogin and authPassword - login and password of an account for authorization. This options are NOT required. Authorization is necessary for alternative methods of obtaining data and provides more stability when you using the undocumented API. I advise you to create a separate account for this with disabled two-step authentication. Authorization data is not transferred to third parties and author of the widget
  • loginAvailable - If you need to separate logins on diffent website pages, just add possible logins to the array below. After that you can send login to the widget by GET variable. It workds only with the undocumented API. Example: /inwidget/index.php?login=fotokto_ru
  • tagsAvailable - Same option for tagged media. Add possible tags to the array below. Then you can use GET variable for tags. Example: /inwidget/index.php?tag=photography. You can mix this option with "loginAvailable" and "tagsFromAccountOnly"
  • tagsBannedLogins - Specify here list of banned logins. Photos of these users will not be display in the widget. Separate usernames by a comma. For example: mark18, kitty45
  • tagsFromAccountOnly - Search tagged media from your account only [ true / false ]. To improve search increase value of "imgCount" option
  • imgRandom - Random order of pictures [ true / false ]
  • imgCount - How many pictures the widget will get from Instagram?
  • cacheExpiration - Cache expiration time (hours)
  • cacheSkip - Skip cache data [ true / false ]. So mean, requests to Instagram API will be sending every time. Warning! Use true value only for debug
  • cachePath - Full path to the cache directory
  • skinDefault - Default skin. Possible values: default, modern-blue, modern-green, modern-red, modern-orange, modern-grey, modern-black, modern-violet, modern-yellow. This option may no effect if you set a skin by $_GET variable
  • skinPath - Path to the skins directory
  • langDefault - Default language [ ru / en / ua ] or something else from the langs directory
  • langPath - Full path to the langs directory
  • langAuto - Language auto-detection [ true / false ]. This option may no effect if you set a language by $_GET variable

4. Paste this code into your html template

<!-- default -->
<iframe src='/inwidget/index.php' scrolling='no' frameborder='no' style='border:none;width:260px;height:330px;overflow:hidden;'></iframe> 

Or use another examples with different display type:

<!-- Without profile -->
<iframe src='/inwidget/index.php?toolbar=false' data-inwidget scrolling='no' frameborder='no' style='border:none;width:260px;height:320px;overflow:hidden;'></iframe>

<!-- Mini 1 -->
<iframe src='/inwidget/index.php?width=100&inline=2&view=12&toolbar=false' data-inwidget scrolling='no' frameborder='no' style='border:none;width:100px;height:320px;overflow:hidden;'></iframe>

<!-- Mini 2 -->
<iframe src='/inwidget/index.php?width=100&inline=1&view=3&toolbar=false' data-inwidget scrolling='no' frameborder='no' style='border:none;width:100px;height:320px;overflow:hidden;'></iframe>

<!-- Horizontal orientation -->
<iframe src='/inwidget/index.php?width=800&inline=7&view=14&toolbar=false' data-inwidget scrolling='no' frameborder='no' style='border:none;width:800px;height:295px;overflow:hidden;'></iframe>

<!-- Large previews -->
<iframe src='/inwidget/index.php?width=800&inline=3&view=9&toolbar=false&preview=large' data-inwidget scrolling='no' frameborder='no' style='border:none;width:800px;height:850px;overflow:hidden;'></iframe> 

Fine-tune widget display

Parameters are passed as GET variables when accessing to the widget script. For that you must change the URL in IFRAME tag. For example, to set the widget width to 600px and display five photos per a single row, you need to add appropriate parameters in the URL.

/inwidget/index.php?width=600&inline=5

List of parameters:

  • width - the widget width (default: 260px)
  • inline - number of photos per line (default: 4 pcs.)
  • view - how many photos can be displayed in the widget (default: 12 pcs, max.: 30 pcs, you can change it in config.php)
  • toolbar - display toolbar with avatar and statistics ( true / false, default: true)
  • preview - size and quality of images (small - 320px, large - 640px, fullsize - maximum avalible size, default: large)
  • lang - the widget language (ru / en / ua, default settings are taken from config.php ). Priority of this parameter is higher than for settings in config.php
  • skin - the widget skin (default / modern-blue / modern-green / modern-red / modern-orange / modern-gray / modern-black / modern-violet / modern-yellow). Default value: default. Priority of this parameter is higher than for settings in config.php
  • adaptive - adaptive, responsive mode (true / false, by default: false). Widget will automatically adjust to dimensions of html container or browser window

When you changing width or number of photos, do not forget to change IFRAME tag size.

How to make the widget adaptive / responsive? (example)

Add GET variable "adaptive" in the URL of IFRAME tag.

/inwidget/index.php?adaptive=true

The value must be set to true. After that, the widget will automatically adjust to the dimensions of html container or browser window. In this case, the GET parameter "width" will be ignored, the "inline" parameter will have an effect when the widget width of more than 400px.

Please, see demonstration of adaptive mode: https://inwidget.ru/adaptive.php

Video instruction how to get ACCESS TOKEN

https://www.youtube.com/watch?v=_O669Dx3djw

The URL to generate ACCESS TOKEN:

https://www.instagram.com/oauth/authorize/?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=token&scope=basic

The widget can work with two kinds of API (undocumented and endpoints). Default API is undocumented. Access token is not required for it. Specifying ACCESS TOKEN in the widget's settings takes it to Endpoints API mode (https://www.instagram.com/developer/). If you want to create your own application in Instagram, then use video instruction above. Keep in mind that your application will first get into "sandbox" with following limits:

  • 20 - maximum number of photos that can be obtained per one request.
  • 500 - maximum number of requests per hour.
  • And most importantly - photos can be obtained from your account only. Same goes for selection by tags.

Keep in mind that Instagram has announced the end of support for endpoint API by 2020. More information: https://developers.facebook.com/blog/post/2018/01/30/instagram-graph-api-updates/

For developers

You can include inWidget library in your application and set parameters through the class constructor. Be careful with the file paths when using example below. The classes support autoloading.

By default the widget use undocumented API that provided by instagram-php-scraper library. To switch to the endpoint API, you need to specify ACCESS_TOKEN.

#require_once 'inwidget/classes/Autoload.php';
require_once 'inwidget/classes/InstagramScraper.php';
require_once 'inwidget/classes/Unirest.php';
require_once 'inwidget/classes/InWidget.php';

try {
	
    // Options may change through the class constructor. For example:
    
    $config = array(
       'LOGIN' => 'fotokto_ru',
       'HASHTAG' => '',
       'ACCESS_TOKEN' => '',
       'authLogin' => '',
       'authPassword' => '',
       'tagsBannedLogins' => '',
       'tagsFromAccountOnly' => false,
       'imgRandom' => true,
       'imgCount' => 30,
       'cacheExpiration' => 6,
       'cacheSkip' => false,
       'cachePath' =>  $_SERVER['DOCUMENT_ROOT'].'/inwidget/cache/',
       'skinDefault' => 'default',
       'skinPath'=> '/inwidget/skins/',
       'langDefault' => 'ru',
       'langAuto' => false,
       'langPath' => $_SERVER['DOCUMENT_ROOT'].'/inwidget/langs/',
    );
    
    $inWidget = new \InWidget\Core($config);
	
    // Also, you may change default values of properties

    /*
    $inWidget->width = 800;         // widget width in pixels
    $inWidget->inline = 6;          // number of images in single line
    $inWidget->view = 18;	        // number of images in widget
    $inWidget->toolbar = false;     // show profile avatar, statistic and action button
    $inWidget->preview = 'large';   // quality of images: small, large, fullsize
    $inWidget->adaptive = false;    // enable adaptive mode
    $inWidget->skipGET = true;      // skip GET variables to avoid name conflicts
    $inWidget->setOptions();        // apply new values
    */
	
    $inWidget->getData();
    include 'inwidget/template.php';

}
catch (\Exception $e) {
    echo $e->getMessage();
}

Error codes

ERROR #101 - can not access to the cached file. You need to change permissions for directory: /inwidget/cache

If cached file does not exist, the widget will try to create it. Then the widget will try to open it for reading and writing. Incorrect rights provide this error. If you already had some files in the cache directory, just delete them, because they also may has incorrect rights.

ERROR #102 - can not get the last modification time of the cached file.

Perhaps, this function is limited or not supported by your server's file system. If the widget can not determine the time, cache will always be irrelevant, which will result in permanent requests to Instagram API.

ERROR #500 - unknown error

Please, see what exactly was written into the cached file. This error is generated by the official API or instagram-php-scraper library. In most cases, it means a problem when sending or receiving data from Instagram server. Delete the cached file and refresh a page (on which the widget is displayed) to try send request again.

Feedback, questions and suggestions

Donate

inWidget is a non-profit library that exists on bare enthusiasm. Your support are welcome!

PayPal: [email protected]

Thank you!

Copyrights

License

This library is free software; you can redistribute it and/or modify it under the terms of MIT license: https://inwidget.ru/MIT-license.txt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].