reddit-animewallpapersfw 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of reddit-animewallpapersfw might be problematic. Click here for more details.
- package/index.js +24 -0
- package/package.json +23 -0
package/index.js
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
const axios = require('axios');
|
2
|
+
|
3
|
+
async function ImageExtractor(subreddit, limit) {
|
4
|
+
let url = 'https://api.reddit.com/r/AnimeWallpaperSFW/hot?limit=10';
|
5
|
+
|
6
|
+
const response = await axios.get(url).then((res) => res.data);
|
7
|
+
|
8
|
+
const { data } = response;
|
9
|
+
const { children } = data;
|
10
|
+
|
11
|
+
children.map((child) => {
|
12
|
+
const { data: info } = child;
|
13
|
+
const { link_flair_text: type, title, subreddit, url } = info;
|
14
|
+
console.log('type', type + ' ' + url + ' ' + title);
|
15
|
+
});
|
16
|
+
|
17
|
+
}
|
18
|
+
|
19
|
+
ImageExtractor()
|
20
|
+
|
21
|
+
|
22
|
+
module.exports = {
|
23
|
+
ImageExtractor
|
24
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"name": "reddit-animewallpapersfw",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "A code to extract image url title and other stuff frem reddit",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "Knight Shrestha",
|
10
|
+
"license": "MIT",
|
11
|
+
"dependencies": {
|
12
|
+
"axios": "^0.26.1"
|
13
|
+
},
|
14
|
+
"devDependencies": {},
|
15
|
+
"repository": {
|
16
|
+
"type": "git",
|
17
|
+
"url": "git+https://github.com/Knightshrestha/reddit-image.git"
|
18
|
+
},
|
19
|
+
"bugs": {
|
20
|
+
"url": "https://github.com/Knightshrestha/reddit-image/issues"
|
21
|
+
},
|
22
|
+
"homepage": "https://github.com/Knightshrestha/reddit-image#readme"
|
23
|
+
}
|