Changing the excerpt content to last post

Update: I’ve just realised /posts.json does that :man_facepalming:


Hi everyone.

I want to pull Discourse last messages/topics on my website. So far, I’ve been using the Json feed and it’s working fine.

I am able to pull the author and last author image, url of the post, likes count and… excerpt

I’ve used this short plugin in order to force excerpt to show up on Json feed.

Url: https://github.com/carlo-13/discourse-excerpts/blob/master/plugin.rb
Originally found on: https://meta.discourse.org/t/show-excerpt-for-all-topics-via-a-theme/81638

Ideally, I’d like to use the last reply as “excerpt”, not the first message. Is it possible to do it? Is it safe? I don’t want to damage my forum :sweat_smile: