summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-14 16:55:38 +0300
committerAndrew Dolgov <[email protected]>2019-08-14 16:55:38 +0300
commit68e2b05f657dca2a389cb9d585215c126e5da290 (patch)
tree50bc7e4ae3661b08cadec7bdf0b29100dc355dd0 /classes/api.php
parent26dbe02968f543913f67c3d6966ae5fe454d2ab1 (diff)
* move get_article_image to Article; implement better og:image detection (similar to android app)
* pass article image to API clients in headlines row object
Diffstat (limited to 'classes/api.php')
-rwxr-xr-xclasses/api.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/classes/api.php b/classes/api.php
index 45e4d3062..0c5c30135 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -759,9 +759,10 @@ class API extends Handler {
"tags" => $tags,
);
+ $enclosures = Article::get_article_enclosures($line['id']);
+
if ($include_attachments)
- $headline_row['attachments'] = Article::get_article_enclosures(
- $line['id']);
+ $headline_row['attachments'] = $enclosures;
if ($show_excerpt)
$headline_row["excerpt"] = $line["content_preview"];
@@ -801,7 +802,8 @@ class API extends Handler {
$headline_row = $p->hook_render_article_api(array("headline" => $headline_row));
}
- $headline_row['content'] = DiskCache::rewriteUrls($headline_row['content']);
+ $headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
+ $headline_row["flavor_image"] = Article::get_article_image($enclosures, $line["content"], $line["site_url"]);
array_push($headlines, $headline_row);
}