citizenelah
6 months agoAce
API for newly published articles?
I'd like to automate social copy drafts in our social media platform for newly published articles. I can't seem to find the right combination of attributes / tables in a LiQL call OR the right API method that will give me what I'm looking for. I just want the last 10 articles that were published. I get the last updated, which could be older articles, and I published one two days ago that was a draft a month ago. That doesn't show up in my query of 10 at all as it's out of range, unfortunately.
Any advice on how to accomplish this would be appreciated.
The LiQL query I'm using:
query = f"SELECT id, view_href, body, last_publish_time FROM messages WHERE board.id = 'TechnicalArticles' ORDER BY manual_sort limit 10"
I got it! Had to combine post_time AND manual_sort to get the results to match my latest published article:
query = "SELECT id, view_href, body, last_publish_time FROM messages WHERE board.id = 'TechnicalArticles' ORDER BY manual_sort, post_time desc limit 10"
Thanks karuna179 for the nudge and the help with post_time!