forked from blallo/rss-bridge
parent
8ba817478b
commit
29c690dbcd
1 changed files with 8 additions and 7 deletions
|
@ -47,9 +47,10 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
$json = trim(substr($innertext, $pos + 18), ' =;');
|
$json = trim(substr($innertext, $pos + 18), ' =;');
|
||||||
$data = json_decode($json);
|
$data = json_decode($json);
|
||||||
|
|
||||||
$userMedia = $data->entry_data->ProfilePage[0]->user->media->nodes;
|
$userMedia = $data->entry_data->ProfilePage[0]->graphql->user->edge_owner_to_timeline_media->edges;
|
||||||
|
|
||||||
foreach($userMedia as $media) {
|
foreach($userMedia as $media) {
|
||||||
|
$media = $media->node;
|
||||||
// Check media type
|
// Check media type
|
||||||
switch($this->getInput('media_type')) {
|
switch($this->getInput('media_type')) {
|
||||||
case 'all': break;
|
case 'all': break;
|
||||||
|
@ -63,14 +64,14 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = self::URI . 'p/' . $media->code . '/';
|
$item['uri'] = self::URI . 'p/' . $media->shortcode . '/';
|
||||||
$item['content'] = '<img src="' . htmlentities($media->display_src) . '" />';
|
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" />';
|
||||||
if (isset($media->caption)) {
|
if (isset($media->edge_media_to_caption->edges[0]->node->text)) {
|
||||||
$item['title'] = $media->caption;
|
$item['title'] = $media->edge_media_to_caption->edges[0]->node->text;
|
||||||
} else {
|
} else {
|
||||||
$item['title'] = basename($media->display_src);
|
$item['title'] = basename($media->display_url);
|
||||||
}
|
}
|
||||||
$item['timestamp'] = $media->date;
|
$item['timestamp'] = $media->taken_at_timestamp;
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue