Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Cn Database Generator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
神之吹息
Ygopro Cn Database Generator
Commits
f94edb4d
Commit
f94edb4d
authored
Oct 08, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert chars to full size
parent
ed9b1707
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
src/fetcher.ts
src/fetcher.ts
+12
-3
No files found.
src/fetcher.ts
View file @
f94edb4d
...
...
@@ -4,6 +4,15 @@ import axios from "axios";
import
_
from
"
underscore
"
;
import
Base
from
"
./base
"
;
function
convertCharToFullSize
(
char
:
string
)
{
const
charCode
=
char
.
charCodeAt
(
0
);
if
(
charCode
!==
32
&&
charCode
<
127
)
{
return
String
.
fromCharCode
(
charCode
+
65248
);
}
return
char
;
}
export
class
CNFetcher
extends
Base
{
private
async
fetchPage
(
url
:
string
):
Promise
<
string
>
{
this
.
log
.
debug
(
`Downloading content from
${
url
}
.`
);
...
...
@@ -20,9 +29,9 @@ export class CNFetcher extends Base {
return
[];
}
const
allCardNames
=
allStrings
.
map
(
m
=>
m
.
match
(
/<font color="Silver">
\u
203b
(
.*
)
<
\/
font><br
\/
>/
)[
1
]);
const
uni
ueCardNames
=
_
.
uniq
(
allCardNames
);
this
.
log
.
debug
(
`
${
uniueCardNames
.
length
}
cards found from
${
url
}
.`
);
return
uniueCardNames
;
const
uni
queCardNames
=
_
.
uniq
(
allCardNames
).
map
(
m
=>
Array
.
from
(
m
).
map
(
convertCharToFullSize
).
join
(
""
)
);
this
.
log
.
debug
(
`
${
uni
q
ueCardNames
.
length
}
cards found from
${
url
}
.`
);
return
uni
q
ueCardNames
;
}
async
fetchPosts
():
Promise
<
string
[]
>
{
let
posts
:
string
[]
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment