Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Asutorufa authored Aug 17, 2019
1 parent 7bd9204 commit c7d5e80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions hjen.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ function word(word) {
}else{
let word_audio_en = "英 " + sub$('.word-info .pronounces .pronounce-value-en').text() +' '+ sub$('.word-info .pronounces .word-audio-en').attr('data-src');
let word_audio_us = "美 " + sub$('.word-info .pronounces .pronounce-value-us').text() +' '+ sub$('.word-info .pronounces .word-audio').last().attr('data-src');
console.log(word_text)
console.log(word_audio_en)
console.log(word_text);
console.log(word_audio_en);
console.log(word_audio_us,'\nSimple explanation:');
}

word_simple = sub$('.simple p .simple-definition a');
let word_simple = sub$('.simple p .simple-definition a');
if (word_simple.text() === ""){
sub$('.simple p').map(function(index,html){
word_simple_p$ = cheerio.load(html);
let word_simple_p$ = cheerio.load(html);
console.log(' '+(index+1) +')'+ word_simple_p$.text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " "))
})
}else{
word_simple.map(function (index,html){
word_simple_simple_definition_a$ = cheerio.load(html);
let word_simple_simple_definition_a$ = cheerio.load(html);
console.log(' '+(index+1)+'.'+word_simple_simple_definition_a$.text())
})
}
Expand All @@ -60,7 +60,7 @@ function word(word) {
word_detail_dl_dd$("ul li").map(function (index,html){
let word_detail_dl_dd_ul_li$ = cheerio.load(html);
let eg = word_detail_dl_dd_ul_li$('.def-sentence-from').text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " ");
console.log(' '+eg)
console.log(' '+eg);
let eg2 = word_detail_dl_dd_ul_li$('.def-sentence-to').text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " ");
console.log(' '+eg2)
})
Expand All @@ -74,7 +74,7 @@ function word(word) {
}
let word_detail_li$ = cheerio.load(html);
console.log(' '+(index+1)+'.'+word_detail_li$.text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " "))
})
});

word_detail$('.word-details-item-content .enen-groups dl').map(function (index,html) {
if (index === 0){
Expand All @@ -97,7 +97,7 @@ function word(word) {
}
let word_detail_li$ = cheerio.load(html);
console.log(' '+(index+1)+'.'+word_detail_li$.text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " "))
})
});

word_detail$('.word-details-item-content .syn table tbody td').map(function (index,html){
if (index === 0){
Expand All @@ -106,7 +106,7 @@ function word(word) {
}
let word_detail_li$ = cheerio.load(html);
console.log(' '+(index+1)+'.'+word_detail_li$.text().replace(/[\r\n | \n | \r]/g, " ").replace(/ +/g, " "))
})
});

word_detail$('.word-details-item-content .ant table tbody td').map(function (index,html){
if (index === 0){
Expand All @@ -123,7 +123,7 @@ function word(word) {

check = process.argv.splice(2)[0];
if (check === undefined){
return
// do something
}else{
word(check);
}
2 changes: 1 addition & 1 deletion hjjp.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function word(word) {

check = process.argv.splice(2)[0];
if (check === undefined){
return
// do something
}else{
word(check);
}

0 comments on commit c7d5e80

Please sign in to comment.