This repository was archived by the owner on Jul 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathindex.php
More file actions
103 lines (85 loc) · 3.24 KB
/
index.php
File metadata and controls
103 lines (85 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* Project: inWidget: show pictures from instagram.com on your site!
* File: index.php
*
* 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
*
* @link https://inwidget.ru
* @copyright 2014-2020 Alexandr Kazarmshchikov
* @author Alexandr Kazarmshchikov
* @version 1.3.3
* @package inWidget
*
*/
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
setlocale(LC_ALL, "ru_RU.UTF-8");
header('Content-type: text/html; charset=utf-8');
if (phpversion() < "5.4.0") {
die('inWidget required PHP >= <b>5.4.0</b>. Your version: ' . phpversion());
}
if (!extension_loaded('curl')) {
die('inWidget required <b>cURL PHP extension</b>. Please, install it or ask your hosting provider.');
}
#ini_set('include_path', __DIR__ .'/' );
#require_once 'classes/Autoload.php';
require_once 'classes/InstagramScraper.php';
require_once 'classes/Unirest.php';
require_once 'classes/InWidget.php';
/* -----------------------------------------------------------
Native initialization
------------------------------------------------------------*/
try {
$inWidget = new \InWidget\Core();
$inWidget->getData();
include 'template.php';
} catch (\Exception $e) {
echo $e->getMessage();
}
/* -----------------------------------------------------------
Custom initialization
------------------------------------------------------------*/
/*
try {
// Options may change through the class constructor. For example:
$config = array(
'LOGIN' => 'fotokto_ru',
'HASHTAG' => '',
'ACCESS_TOKEN' => '',
'authLogin' => '',
'authPassword' => '',
'tagsBannedLogins' => '',
'tagsFromAccountOnly' => false,
'imgRandom' => false,
'imgCount' => 30,
'cacheExpiration' => 6,
'cacheSkip' => false,
'cachePath' => __DIR__.'/cache/',
'skinDefault' => 'default',
'skinPath'=> 'skins/',
'langDefault' => 'ru',
'langAuto' => false,
'langPath' => __DIR__.'/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 'template.php';
// Also, you may use API methods directly
// $account = $inWidget->api->getAccountByLogin($config['LOGIN'], $config['ACCESS_TOKEN'], $config['imgCount']);
// $mediasByLogin = $inWidget->api->getMediasByLogin($config['LOGIN'], $config['ACCESS_TOKEN'], $config['imgCount']);
// $mediasByTag = $inWidget->api->getMediasByTag('girl', $config['ACCESS_TOKEN'], $config['imgCount']);
} catch (\Exception $e) {
echo $e->getMessage();
}
*/