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

(Muzammil Ahmed) #1

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.

(Jay Pfaffman) #2

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) #3

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) #4

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) #5

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) #6

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) #7

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)

(Kane York) #8

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