Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param $username string
- * @param $isLink boolean
- * @return bool
- */
- public static function getUserInfoRequest($username, $isLink = false)
- {
- if (strpos($username, self::WEB_INSTAGRAM_URL . '/') !== false) {
- $username = str_replace(self::WEB_INSTAGRAM_URL . '/', '', $username);
- if (strpos($username, '/') !== false) {
- $username = explode('/', $username)[0];
- }
- }
- $link = self::WEB_INSTAGRAM_URL . '/' . $username . '/?__a=1';
- $content = self::_request($link);
- try {
- $content = json_decode($content, true);
- } catch (Exception $e) {
- return false;
- }
- if (!isset($content['user'])) {
- return false;
- }
- return $content['user'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement