Skip to content

Commit

Permalink
Api Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantur13 committed Dec 24, 2022
1 parent 42ff05d commit f5422e2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</p>

> Logo by u/RamenFish195
>> Available as node package,api on RapidAPI
>
> > Available as [node package](https://www.npmjs.com/package/reddit-memes-api),api on [RapidAPI](https://rapidapi.com/jayantur13/api/memes-from-reddit)
## Installation

Expand All @@ -22,7 +23,7 @@ Install using npm or yarn

## API Reference

#### Type 1 - data
#### Type 1 - Get data

```http
GET /${subreddit}
Expand Down
27 changes: 21 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ app.get("/:subreddit", async (req, res) => {
let author = el.data.author;
let title = el.data.title;
let post_hint = el.data.post_hint;
let img = el.data.url_overridden_by_dest;
data.push(author, title, post_hint, img);
let url = el.data.url_overridden_by_dest;
data.push({
"author": author,
"title": title,
"post_hint": post_hint,
"url": url,
});
});
let error = false;
let code = 200;
Expand Down Expand Up @@ -103,8 +108,13 @@ app.get("/:subreddit/:memesare", async (req, res) => {
let author = el.data.author;
let title = el.data.title;
let post_hint = el.data.post_hint;
let img = el.data.url_overridden_by_dest;
data.push(author, title, post_hint, img);
let url = el.data.url_overridden_by_dest;
data.push({
"author": author,
"title": title,
"post_hint": post_hint,
"url": url,
});
});
let error = false;
let code = 200;
Expand Down Expand Up @@ -161,8 +171,13 @@ app.get("/:subreddit/:memesare/:freq/", async (req, res) => {
let author = el.data.author;
let title = el.data.title;
let post_hint = el.data.post_hint;
let img = el.data.url_overridden_by_dest;
data.push(author, title, post_hint, img);
let url = el.data.url_overridden_by_dest;
data.push({
"author": author,
"title": title,
"post_hint": post_hint,
"url": url,
});
});
let error = false;
let code = 200;
Expand Down

1 comment on commit f5422e2

@vercel
Copy link

@vercel vercel bot commented on f5422e2 Dec 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.