A partial archive of meta.discourse.org as of Tuesday July 18, 2017.

How to fetch all new topics and users replies within 24 hours by cron?

Muzammil_Ahmed

I’m new to discourse and want to create a cron which fetch all the topics with users replies from last 24 hours and integrate that cron into discourse docker container.

pfaffman

Can you say what it is that you’re actually trying to accomplish and why this might be the solution? Fetch them and do what with them?

E.g., Have you looked at /latest and /admin/users?

Muzammil_Ahmed

I want to build cron to fetch these data and send it on my slack channel. I’ve also explored discourse slack plugin but its not like meeting my requirement.

David_Taylor

Why doesn’t the slack plugin meet your requirement?

If you explain exactly what result you want, it’ll be easier for people to provide suggestions.

Muzammil_Ahmed

I want to build a cron which fetch all new topics with users replies within 24 hours and send them one by one on my slack channel because it will easier for me to know how many topics are created and users replies instead of login into discourse forum manually.

David_Taylor

That’s exactly what the slack plugin does… Is there a specific need for them to all be posted in one go in a cron job?

If you really want to do this yourself, probably the easiest thing to do is access the API from another server as @pfaffman said above.

Muzammil_Ahmed

Discourse slack plugin send notifications on slack channel but its not have time frame feature. I need to send notifications for past 24 hours activities(latest topics & users replies)

riking

If you want to inspect every single new post, check out /posts.json with the before parameter which takes a (potentially future) post ID