Skip to content

Commit

Permalink
Rename InstagramScraper to Instagram
Browse files Browse the repository at this point in the history
  • Loading branch information
raiym committed May 10, 2016
1 parent 0fcaf70 commit df4dfcf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


```php
use InstagramScraper\InstagramScraper;
use InstagramScraper\Instagram;

$instagram = new InstagramScraper();
$instagram = new Instagram();
$account = $instagram->getAccount('kevin');
/*
Available properties:
Expand Down
2 changes: 1 addition & 1 deletion src/InstagramScraper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

require_once dirname(__FILE__) . '/InstagramScraper/InstagramDataProvider.php';
require_once dirname(__FILE__) . '/InstagramScraper/InstagramScraper.php';
require_once dirname(__FILE__) . '/InstagramScraper/Instagram.php';
require_once dirname(__FILE__) . '/InstagramScraper/Account.php';
require_once dirname(__FILE__) . '/InstagramScraper/Media.php';
require_once dirname(__FILE__) . '/InstagramScraper/InstagramException.php';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Unirest\Request;

class InstagramScraper implements InstagramDataProvider
class Instagram implements InstagramDataProvider
{
const INSTAGRAM_URL = 'https://www.instagram.com/';

Expand Down
6 changes: 4 additions & 2 deletions src/InstagramScraper/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public static function fromApi($mediaArray)
$instance->imageThumbnailUrl = self::getCleanImageUrl($mediaArray['images']['thumbnail']['url']);
$instance->imageStandardResolutionUrl = self::getCleanImageUrl($mediaArray['images']['standard_resolution']['url']);
$instance->imageHighResolutionUrl = str_replace('320x320', '1080x1080', $instance->imageLowResolutionUrl);
$instance->caption = $mediaArray['caption']['text'];
if (isset($mediaArray['caption'])) {
$instance->caption = $mediaArray['caption']['text'];
}
if ($instance->type === 'video') {
$instance->videoLowResolutionUrl = $mediaArray['videos']['low_resolution']['url'];
$instance->videoStandardResolutionUrl = $mediaArray['videos']['standard_resolution']['url'];
Expand All @@ -60,7 +62,7 @@ public static function fromMediaPage($mediaArray)
}
$instance->createdTime = $mediaArray['date'];
$instance->code = $mediaArray['code'];
$instance->link = InstagramScraper::INSTAGRAM_URL . 'p/' . $instance->code;
$instance->link = Instagram::INSTAGRAM_URL . 'p/' . $instance->code;
$instance->imageStandardResolutionUrl = self::getCleanImageUrl($mediaArray['display_src']);
$instance->imageLowResolutionUrl = str_replace('640x640', '320x320', $instance->imageStandardResolutionUrl);
$instance->imageHighResolutionUrl = str_replace('640x640', '1080x1080', $instance->imageStandardResolutionUrl);
Expand Down

0 comments on commit df4dfcf

Please sign in to comment.