Compare commits

..

No commits in common. "cde0a78d3986ce795bd10bfd9b400ab6ad651578" and "95afc76a5c2d67da016c4bd6896ae8e39d7579ee" have entirely different histories.

9 changed files with 2 additions and 21 deletions

View file

@ -25,7 +25,6 @@ By default, the command will fetch a random image from `r/rabbits` and return it
$ random-bunny $ random-bunny
Archived = false Archived = false
Author = Rabbit_Owner
Downvotes = 0 Downvotes = 0
Hidden = false Hidden = false
Permalink = /r/Rabbits/comments/1av1rg9/cute_baby_bun/ Permalink = /r/Rabbits/comments/1av1rg9/cute_baby_bun/
@ -73,7 +72,7 @@ $ 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,"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"}
``` ```
## Sort ## Sort

View file

@ -37,7 +37,6 @@ Returns a `json string` for a random post. Accepts 3 arguments: `subreddit`, `so
The json string which gets returned consists of: The json string which gets returned consists of:
- archived - archived
- author
- downs - downs
- hidden - hidden
- permalink - permalink

View file

@ -1,7 +1,6 @@
export default interface IFetchResult { export default interface IFetchResult {
data: { data: {
archived: boolean, archived: boolean,
author: string,
downs: number, downs: number,
hidden: boolean, hidden: boolean,
permalink: string, permalink: string,

View file

@ -1,6 +1,5 @@
export default interface IRedditResult { export default interface IRedditResult {
Archived: boolean, Archived: boolean,
Author: string,
Downs: number, Downs: number,
Hidden: boolean, Hidden: boolean,
Permalink: string, Permalink: string,

View file

@ -12,7 +12,6 @@ export default class OutputHelper {
} }
outputLines.push(`Archived = ${result.Archived}`); outputLines.push(`Archived = ${result.Archived}`);
outputLines.push(`Author = ${result.Author}`);
outputLines.push(`Downvotes = ${result.Downs}`); outputLines.push(`Downvotes = ${result.Downs}`);
outputLines.push(`Hidden = ${result.Hidden}`); outputLines.push(`Hidden = ${result.Hidden}`);
outputLines.push(`Permalink = ${result.Permalink}`); outputLines.push(`Permalink = ${result.Permalink}`);

View file

@ -118,7 +118,6 @@ export default async function randomBunny(subreddit: string, sortBy: "new" | "ho
} }
const redditResult: IRedditResult = { const redditResult: IRedditResult = {
Author: randomData['author'],
Archived: randomData['archived'], Archived: randomData['archived'],
Downs: randomData['downs'], Downs: randomData['downs'],
Hidden: randomData['hidden'], Hidden: randomData['hidden'],

View file

@ -2,7 +2,6 @@
exports[`GenerateOutput EXPECT standout output to be returned 1`] = ` exports[`GenerateOutput EXPECT standout output to be returned 1`] = `
"Archived = false "Archived = false
Author = author
Downvotes = 0 Downvotes = 0
Hidden = false Hidden = false
Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/ Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/
@ -13,11 +12,10 @@ Upvotes = 17
Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d" Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
`; `;
exports[`GenerateOutput GIVEN options.json is true, EXPECT output to be returned as JSON 1`] = `"{"Archived":false,"Author":"author","Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/","Subreddit":"Rabbits","SubredditSubscribers":654751,"Title":"This is my Ms Bear!","Ups":17,"Url":"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"}"`; exports[`GenerateOutput GIVEN options.json is true, EXPECT output to be returned as JSON 1`] = `"{"Archived":false,"Downs":0,"Hidden":false,"Permalink":"/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/","Subreddit":"Rabbits","SubredditSubscribers":654751,"Title":"This is my Ms Bear!","Ups":17,"Url":"https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"}"`;
exports[`GenerateOutput GIVEN options.queryMetadata is supplied, EXPECT query metadata to be added 1`] = ` exports[`GenerateOutput GIVEN options.queryMetadata is supplied, EXPECT query metadata to be added 1`] = `
"Archived = false "Archived = false
Author = author
Downvotes = 0 Downvotes = 0
Hidden = false Hidden = false
Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/ Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/

View file

@ -14,7 +14,6 @@ describe("GenerateOutput", () => {
}, },
Result: { Result: {
Archived: false, Archived: false,
Author: 'author',
Downs: 0, Downs: 0,
Hidden: false, Hidden: false,
Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/", Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/",
@ -46,7 +45,6 @@ describe("GenerateOutput", () => {
}, },
Result: { Result: {
Archived: false, Archived: false,
Author: 'author',
Downs: 0, Downs: 0,
Hidden: false, Hidden: false,
Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/", Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/",
@ -80,7 +78,6 @@ describe("GenerateOutput", () => {
}, },
Result: { Result: {
Archived: false, Archived: false,
Author: 'author',
Downs: 0, Downs: 0,
Hidden: false, Hidden: false,
Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/", Permalink: "/r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/",

View file

@ -20,7 +20,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -53,7 +52,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -139,7 +137,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -176,7 +173,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -213,7 +209,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -249,7 +244,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -282,7 +276,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',
@ -318,7 +311,6 @@ describe('randomBunny', () => {
{ {
data: { data: {
archived: false, archived: false,
author: 'author',
downs: 0, downs: 0,
hidden: false, hidden: false,
permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/', permalink: '/r/Rabbits/comments/12pa5te/someone_told_pickles_its_monday_internal_fury/',