mirror of
https://github.com/webxoss/wixoss-fetch.git
synced 2024-11-20 05:49:55 +01:00
handle coin
This commit is contained in:
parent
03a740b258
commit
5aaa163374
3 changed files with 29 additions and 13 deletions
20
dist/index.js
vendored
20
dist/index.js
vendored
|
@ -415,7 +415,7 @@ function toCardText(el) {
|
|||
return node.nodeValue.replace(/^\s+/,'').replace(/\s+$/,'')
|
||||
}
|
||||
if (node.nodeName === 'IMG') {
|
||||
return '【' + node.alt + '】'
|
||||
return node.alt
|
||||
}
|
||||
if (node.nodeName === 'BR') {
|
||||
return '\n'
|
||||
|
@ -454,13 +454,21 @@ function toInfo(doc, id) {
|
|||
info.power = trs[3].children[3].textContent
|
||||
info.limiting = trs[4].children[1].textContent
|
||||
|
||||
// guard or limiting
|
||||
if (trs[4].children[2].textContent === 'ガード') {
|
||||
info.guard = trs[4].children[3].textContent
|
||||
// guard, limiting or coin
|
||||
let key = trs[4].children[2].textContent
|
||||
let value = trs[4].children[3].textContent
|
||||
if (key === 'ガード') {
|
||||
info.guard = value
|
||||
info.timing = '-'
|
||||
} else {
|
||||
} else if (key === '使用タイミング') {
|
||||
info.guard = '-'
|
||||
info.timing = trs[4].children[3].textContent
|
||||
info.timing = value
|
||||
} else if (key === 'コイン') {
|
||||
info.guard = '-'
|
||||
info.timing = '-'
|
||||
info.coin = value
|
||||
} else {
|
||||
console.warn(`${info.pid}: unknown key "${key}"!`)
|
||||
}
|
||||
|
||||
let el = doc.querySelector('.card_skill')
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
20
src/index.js
20
src/index.js
|
@ -46,7 +46,7 @@ function toCardText(el) {
|
|||
return node.nodeValue.replace(/^\s+/,'').replace(/\s+$/,'')
|
||||
}
|
||||
if (node.nodeName === 'IMG') {
|
||||
return '【' + node.alt + '】'
|
||||
return node.alt
|
||||
}
|
||||
if (node.nodeName === 'BR') {
|
||||
return '\n'
|
||||
|
@ -85,13 +85,21 @@ function toInfo(doc, id) {
|
|||
info.power = trs[3].children[3].textContent
|
||||
info.limiting = trs[4].children[1].textContent
|
||||
|
||||
// guard or limiting
|
||||
if (trs[4].children[2].textContent === 'ガード') {
|
||||
info.guard = trs[4].children[3].textContent
|
||||
// guard, limiting or coin
|
||||
let key = trs[4].children[2].textContent
|
||||
let value = trs[4].children[3].textContent
|
||||
if (key === 'ガード') {
|
||||
info.guard = value
|
||||
info.timing = '-'
|
||||
} else {
|
||||
} else if (key === '使用タイミング') {
|
||||
info.guard = '-'
|
||||
info.timing = trs[4].children[3].textContent
|
||||
info.timing = value
|
||||
} else if (key === 'コイン') {
|
||||
info.guard = '-'
|
||||
info.timing = '-'
|
||||
info.coin = value
|
||||
} else {
|
||||
console.warn(`${info.pid}: unknown key "${key}"!`)
|
||||
}
|
||||
|
||||
let el = doc.querySelector('.card_skill')
|
||||
|
|
Loading…
Reference in a new issue