vitosamson / modlogs

A service for allowing subreddits to publish their moderator logs
https://modlogs.fyi
14 stars 3 forks source link

Json? #23

Closed rhaksw closed 3 years ago

rhaksw commented 4 years ago

Hi, any plans to expose a json feed, perhaps cached by Cloudflare? I was able to integrate data from the u/publicmodlogs feed and a couple from http://logs.mod.rcoronavirus.org/ into www.reveddit.com. I'm hoping to do the same for u/modlogs.

vitosamson commented 3 years ago

Hey, sorry for the really late response on this.

The logs are already available via the https://modlogs.fyi/api/r/<subreddit>/logs endpoint (this is the endpoint the UI uses to fetch logs), but this isn't cached so please don't abuse it.

What's your use case for the data?

rhaksw commented 3 years ago

Hey, thank you for your reply. Don't worry, if I end up using this, I would cache requests through my own server so it does not burden yours beyond 1 request every few minutes at most. My use case is to add the data to reveddit.com.

By the way, this is a great tool. Thank you for making it!

rhaksw commented 3 years ago

Hi, I just finished implementing a cache for using this on reveddit. Here's an example. Let me know if you see any impact. There should be no noticeable increase of bandwidth or load on your end because when traffic spikes it's usually for a particular page, and each unique request is cached for a minute. So at the most you might get one extra request per minute.

vitosamson commented 3 years ago

Hey, thanks for the heads up. That sounds fine, I’ll let you know if I notice any issues.