microdotblog / issues

42 stars 0 forks source link

JSON Feed for Photos #112

Closed cleverdevil closed 5 years ago

cleverdevil commented 5 years ago

Thanks to the archive JSON Feed, I was able to create https://github.com/cleverdevil/micromemories. I'd love to create an Instagram-like "Photos" page, similar to my website's photos index. In order to do this in the same fashion as my work on "On This Day" pages, I'd need a JSON Feed that I could use to find all photos.

Ideally, I'd like to see a JSON Feed at /photos.json that gives me a reference to each photo, including a thumbnail if available, and a reference to both the full size version, and the permalink to the containing post.

Given this, I'd happily work on "microgram" to enable Micro.blog hosted users to have a nice photo index page.

manton commented 5 years ago

@cleverdevil By the way, there's a global JSON Feed of featured photos if you want to experiment with it (it has image and thumbnail_url fields). When we have this for each user, it will probably look similar: https://micro.blog/feeds/photos.json

cleverdevil commented 5 years ago

Nice, thanks @manton. I should have some time to tinker in the evenings over the Thanksgiving break. I'll make it work using that feed, and then share the results with you.

manton commented 5 years ago

@cleverdevil I rolled out initial support for this and it'll update the feed on any site after its next post or settings change. One limitation is it currently only includes one photo per post instead of separate items for each photo if a post contains multiple photos. I'm considering a major templating change (Jekyll to Hugo) and likely will postpone any more changes until that is ready.

Here's an example feed for my site: https://manton.org/photos/index.json

cleverdevil commented 5 years ago

Awesome, thanks @manton. It appears that the JSON you're generating is actually invalid. Perhaps a missing brace or quote somewhere?

manton commented 5 years ago

@cleverdevil Oops, thanks. Fixed now.

cleverdevil commented 5 years ago

@manton thanks so much, its working -> https://github.com/cleverdevil/microgram

Evidence -> http://cleverangel.org/pictures

manton commented 5 years ago

Thanks again @cleverdevil! Going to close this one now, although I plan to make some improvements in the future, especially to make things faster.