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: discourse-excerpts/plugin.rb at master · carlo-13/discourse-excerpts · GitHub
Originally found on:

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: