Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ TODO.md

.php_cs
.php_cs.cache

.idea/
15 changes: 15 additions & 0 deletions src/Client/Features/FeedFeaturesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Instagram\SDK\Response\Responses\Feed\FeedResponse;
use Instagram\SDK\Response\Responses\Feed\TimelineResponse;
use const Instagram\SDK\TYPE_HASHTAG;
use const Instagram\SDK\TYPE_LOCATION;
use const Instagram\SDK\TYPE_USER;

/**
Expand All @@ -34,6 +35,17 @@ public function feedByHashtag(string $hashTag): PromiseInterface
return $this->feed(TYPE_HASHTAG, $hashTag);
}

/**
* Retrieve feed by hashtag.
*
* @param string $locationId
* @return PromiseInterface<FeedResponse|InstagramException>
*/
public function feedByLocation(string $locationId): PromiseInterface
{
return $this->feed(TYPE_LOCATION, $locationId);
}

/**
* Retrieve feed by user id.
*
Expand Down Expand Up @@ -62,6 +74,9 @@ public function feed(int $type, string $query, ?string $maxId = null): PromiseIn
case TYPE_USER:
$result = $this->queryFeed($type, 'feed/user/%s/', $query, $maxId);
break;
case TYPE_LOCATION:
$result = $this->queryFeed($type, 'feed/location/%s/', $query, $maxId);
break;
default:
$result = $this->getInvalidFeedTypeError();
break;
Expand Down
185 changes: 185 additions & 0 deletions src/Response/DTO/General/Media/Caption.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
<?php

namespace Instagram\SDK\Response\DTO\General\Media;

use Instagram\SDK\Response\DTO\General\User;

final class Caption
{
/** @var integer */
private $pk;

/** @var integer */
private $user_id;

/** @var string */
private $text;

/** @var integer */
private $type;

/** @var integer */
private $created_at;

/** @var integer */
private $created_at_utc;

/** @var string */
private $content_type;

/** @var string */
private $status;

/** @var integer */
private $bit_flags;

/** @var boolean */
private $did_report_as_spam;

/** @var boolean */
private $share_enabled;

/** @var User */
private $user;

/** @var boolean */
private $is_covered;

/** @var integer */
private $media_id;

/** @var boolean */
private $has_translation;

/** @var integer */
private $private_reply_status;

/**
* @return int
*/
public function getPk(): int
{
return $this->pk;
}

/**
* @return int
*/
public function getUserId(): int
{
return $this->user_id;
}

/**
* @return string
*/
public function getText(): string
{
return $this->text;
}

/**
* @return int
*/
public function getType(): int
{
return $this->type;
}

/**
* @return int
*/
public function getCreatedAt(): int
{
return $this->created_at;
}

/**
* @return int
*/
public function getCreatedAtUtc(): int
{
return $this->created_at_utc;
}

/**
* @return string
*/
public function getContentType(): string
{
return $this->content_type;
}

/**
* @return string
*/
public function getStatus(): string
{
return $this->status;
}

/**
* @return int
*/
public function getBitFlags(): int
{
return $this->bit_flags;
}

/**
* @return bool
*/
public function isDidReportAsSpam(): bool
{
return $this->did_report_as_spam;
}

/**
* @return bool
*/
public function isShareEnabled(): bool
{
return $this->share_enabled;
}

/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}

/**
* @return bool
*/
public function isIsCovered(): bool
{
return $this->is_covered;
}

/**
* @return int
*/
public function getMediaId(): int
{
return $this->media_id;
}

/**
* @return bool
*/
public function isHasTranslation(): bool
{
return $this->has_translation;
}

/**
* @return int
*/
public function getPrivateReplyStatus(): int
{
return $this->private_reply_status;
}

}
138 changes: 138 additions & 0 deletions src/Response/DTO/General/Media/CarouselMedia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php

namespace Instagram\SDK\Response\DTO\General\Media;

final class CarouselMedia
{
/**
* @var string
*/
private $id;

/**
* @var int
*/
private $pk;

/**
* @var int
*/
private $media_type;

/**
* @var ImageVersions2|null
*/
private $image_versions2;


/**
* @var VideoVersion[]|null
*/
private $video_versions;

/**
* @var int
*/
private $original_width;

/**
* @var int
*/
private $original_height;

/**
* @var string
*/
private $carousel_parent_id;

/**
* @var bool
*/
private $can_see_insights_as_brand;

/**
* @var bool
*/
private $is_commercial;

/**
* @return string
*/
public function getId(): string
{
return $this->id;
}

/**
* @return int
*/
public function getPk(): int
{
return $this->pk;
}

/**
* @return int
*/
public function getMediaType(): int
{
return $this->media_type;
}

/**
* @return ImageVersions2|null
*/
public function getImageVersions2(): ?ImageVersions2
{
return $this->image_versions2;
}

/**
* @return VideoVersion[]|null
*/
public function getVideoVersions(): ?array
{
return $this->video_versions;
}

/**
* @return int
*/
public function getOriginalWidth(): int
{
return $this->original_width;
}

/**
* @return int
*/
public function getOriginalHeight(): int
{
return $this->original_height;
}

/**
* @return string
*/
public function getCarouselParentId(): string
{
return $this->carousel_parent_id;
}

/**
* @return bool
*/
public function isCanSeeInsightsAsBrand(): bool
{
return $this->can_see_insights_as_brand;
}

/**
* @return bool
*/
public function isIsCommercial(): bool
{
return $this->is_commercial;
}

}
1 change: 0 additions & 1 deletion src/Response/DTO/General/Media/ImageVersions2.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
final class ImageVersions2
{

/**
* @var Image[]
*/
Expand Down
Loading