Add "Gallery" field to return multiple images in 1 post #242

Merged
Vylpes merged 5 commits from feature/161-image-array into develop 2024-10-26 22:00:55 +01:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 91c88b1180 - Show all commits

View file

@ -33,8 +33,11 @@ Subreddit Subscribers = 486084
Title = Cute baby bun Title = Cute baby bun
Upvotes = 211 Upvotes = 211
Url = https://i.redd.it/sfz0srdrimjc1.png Url = https://i.redd.it/sfz0srdrimjc1.png
Gallery = https://i.redd.it/sfz0srdrimjc1.png, https://i.redd.it/sfz0srdrimjc1.png
``` ```
- The `Gallery` field is only shown when there is more than 1 image returned, which then the `Url` field is the first image of that list.
## Help ## Help
The command also includes a help option in case you are stuck. The command also includes a help option in case you are stuck.
@ -72,9 +75,11 @@ $ random-bunny --json
$ randon-bunny -j $ randon-bunny -j
{"Archived":false,"Author":"Rabbit_Owner","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1av1rg9/cute_baby_bun/","Subreddit":"Rabbits","SubredditSubscribers":486085,"Title":"Cute baby bun","Ups":210,"Url":"https://i.redd.it/sfz0srdrimjc1.png"} {"Archived":false,"Author":"Rabbit_Owner","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1av1rg9/cute_baby_bun/","Subreddit":"Rabbits","SubredditSubscribers":486085,"Title":"Cute baby bun","Ups":210,"Url":"https://i.redd.it/sfz0srdrimjc1.png","Gallery":["https://i.redd.it/sfz0srdrimjc1.png"]}
``` ```
- The `Url` field is the first image of the `Gallery` array
## Sort ## Sort
You can also choose the sorting option which reddit will use to return the available posts to randomise from. You can also choose the sorting option which reddit will use to return the available posts to randomise from.

View file

@ -39,6 +39,7 @@ The json string which gets returned consists of:
- archived - archived
- author - author
- downs - downs
- gallery
- hidden - hidden
- permalink - permalink
- subreddit - subreddit