From 77061d8417f2b3975572d6c51b15bc6dd46e8b6d Mon Sep 17 00:00:00 2001 From: pplokijuhyg <1162963624@qq.com> Date: Thu, 26 Dec 2019 18:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/reptile/binimport.js | 36 ++++++++++++++++++++++++++++++++ bin/reptile/gufengmh8/config.js | 17 +++++++++++++++ bin/reptile/gufengmh8/find.js | 4 ++-- bin/reptile/gufengmh8/picture.js | 5 +++-- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 bin/reptile/binimport.js create mode 100644 bin/reptile/gufengmh8/config.js diff --git a/bin/reptile/binimport.js b/bin/reptile/binimport.js new file mode 100644 index 0000000..5ce9dcd --- /dev/null +++ b/bin/reptile/binimport.js @@ -0,0 +1,36 @@ +let fs = require("fs") +let getreptilelist =(dirlist)=>{ + new Promise((res,err)=>{ + console.log(dirlist) + for(let i in dirlist){ + let reptile = require(__dirname + "/" + dirlist[i] +"/config.js" ) + console.log(reptile) + reptilelist.push(reptile) + } + }) +} + + +getlist =()=>{ + new Promise((r,e)=>{ + fs.readdir(__dirname, (err, res) => { + for (let i in res) { + if (res[i] == "binimport.js") { + res.splice(i, 1) + } + } + dirlist = res + // console.log(res) + getreptilelist(dirlist).then((s)=>{ + r(s) + }) + }) + }) +} + +module.exports = getlist() + + + + + diff --git a/bin/reptile/gufengmh8/config.js b/bin/reptile/gufengmh8/config.js new file mode 100644 index 0000000..7bcd06a --- /dev/null +++ b/bin/reptile/gufengmh8/config.js @@ -0,0 +1,17 @@ +// import find from "./find" +// import imglist from "./picture" +// import section from "./section" +find = require("./find") +imglist = require("./picture") +section = require("./section") +let name = "古风漫画" +let version = "19.12.26" +let type = 1 +module.exports = { + name, + version, + type, + find, + imglist, + section +} \ No newline at end of file diff --git a/bin/reptile/gufengmh8/find.js b/bin/reptile/gufengmh8/find.js index ee529e7..d2c8ed3 100644 --- a/bin/reptile/gufengmh8/find.js +++ b/bin/reptile/gufengmh8/find.js @@ -39,5 +39,5 @@ let getlist = async (name) => { console.log(JSON.stringify(html)) return html; } -getlist("偷星九月天") -// module.exports = getlist \ No newline at end of file +// getlist("偷星九月天") +module.exports = getlist \ No newline at end of file diff --git a/bin/reptile/gufengmh8/picture.js b/bin/reptile/gufengmh8/picture.js index 4b320aa..9e60c64 100644 --- a/bin/reptile/gufengmh8/picture.js +++ b/bin/reptile/gufengmh8/picture.js @@ -2,7 +2,7 @@ const cheerio = require('cheerio'); const axios = require('axios') let getscript = async (url) => { let text; - await axios.get('https://www.gufengmh8.com/manhua/touxingjiuyuetian/1152122.html').then((res)=>{ + await axios.get(url).then((res)=>{ // text = res.text // console.log(res.data) text = res.data @@ -29,4 +29,5 @@ let getscript = async (url) => { }) } -getscript('') \ No newline at end of file +// getscript('') +module.exports = getscript \ No newline at end of file