diff options
| author | horus | 2024-01-16 01:11:20 +0100 |
|---|---|---|
| committer | horus | 2024-01-16 01:11:20 +0100 |
| commit | b68cfe7aaf949106be34b9d2e439baf5d55e6d7e (patch) | |
| tree | 50c07752a116dee4ea3b6319450f12e5610beb5a | |
| parent | 32f972b2ac74e4fa553ef27ef004c8cce85aad36 (diff) | |
| download | curious-b68cfe7aaf949106be34b9d2e439baf5d55e6d7e.tar.gz | |
change link in mastodon feed
| -rw-r--r-- | app/Libraries/Helper.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/Libraries/Helper.php b/app/Libraries/Helper.php index a900b87..311c466 100644 --- a/app/Libraries/Helper.php +++ b/app/Libraries/Helper.php @@ -81,17 +81,8 @@ class Helper { $cat_counter = $post->getCategories()->get()->count(); $cat_len = mb_strlen($categories, "UTF-8"); } - - $discussions = ""; - if ( $post->getDiscussions()->orderBy('created_at', 'desc')->get()->count() > 1 ) { - // multiple discussions on HN. show one link where you can find them all - $discussions = env('APP_URL') . "/article/" . $post->id; - } else { - // only on disc link. ### TODO foreach not needed - foreach( $post->getDiscussions()->orderBy('created_at', 'desc')->get() as $dis ) { - $discussions = $dis->source_url; - } - } + + $link = env('APP_URL') . "/article/" . $post->id; // max desc length is 500 - 23 (Link) - $cat_len - 2 (white spaces) $max_len = 500 - 23 - $cat_len - 2; @@ -104,8 +95,8 @@ class Helper { $feed->addItem([ 'title' => $desc, // mastofeed.org seems to ignore the description field 'author' => env('APP_NAME'), - 'url' => \URL::to($post->url), - 'link' => \URL::to($post->url), + 'url' => $link, + 'link' => $link, 'pubdate' => $post->created_at, 'description' => $desc, 'content' => $desc |
