Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tx3-bang-reader
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
nanahira
tx3-bang-reader
Commits
eef6b14a
Commit
eef6b14a
authored
Jul 01, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
7241e206
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12495 additions
and
34 deletions
+12495
-34
src/utility.ts
src/utility.ts
+1
-1
tests/28_20588.json
tests/28_20588.json
+29
-29
tests/6_18804822.html
tests/6_18804822.html
+2067
-0
tests/6_18804822.json
tests/6_18804822.json
+10389
-0
tests/test-user.ts
tests/test-user.ts
+9
-4
No files found.
src/utility.ts
View file @
eef6b14a
...
...
@@ -113,7 +113,7 @@ export function getString(node: HTML.Node) {
export
function
getNumber
(
node
:
HTML
.
Node
)
{
const
numberStr
=
getString
(
node
);
let
stringMatch
:
RegExpMatchArray
;
if
(
numberStr
===
"
没有上榜
"
)
{
if
(
numberStr
===
"
没有上榜
"
||
!
numberStr
)
{
return
null
;
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
([
天地
])
魂$/
))
{
return
stringMatch
[
1
]
===
"
天
"
?
2
:
1
;
...
...
tests/28_20588.json
View file @
eef6b14a
This diff is collapsed.
Click to expand it.
tests/6_18804822.html
0 → 100644
View file @
eef6b14a
This diff is collapsed.
Click to expand it.
tests/6_18804822.json
0 → 100644
View file @
eef6b14a
This diff is collapsed.
Click to expand it.
tests/test-user.ts
View file @
eef6b14a
import
{
User
}
from
"
../src/user
"
;
import
fs
from
"
fs
"
;
import
HTML
from
"
posthtml-parser
"
;
async
function
main
()
{
let
html
=
await
fs
.
promises
.
readFile
(
"
./tests/28_20588.html
"
,
"
utf-8
"
);
console
.
log
(
new
User
(
"
28_20588
"
,
html
,
null
));
html
=
await
fs
.
promises
.
readFile
(
"
./tests/60_46782.html
"
,
"
utf-8
"
);
console
.
log
(
new
User
(
"
60_46782
"
,
html
,
null
));
let
id
=
"
28_20588
"
;
let
html
=
await
fs
.
promises
.
readFile
(
`./tests/
${
id
}
.html`
,
"
utf-8
"
);
await
fs
.
promises
.
writeFile
(
`./tests/
${
id
}
.json`
,
JSON
.
stringify
(
HTML
(
html
),
null
,
2
));
console
.
log
(
new
User
(
id
,
html
,
null
));
id
=
"
6_18804822
"
;
html
=
await
fs
.
promises
.
readFile
(
`./tests/
${
id
}
.html`
,
"
utf-8
"
);
await
fs
.
promises
.
writeFile
(
`./tests/
${
id
}
.json`
,
JSON
.
stringify
(
HTML
(
html
),
null
,
2
));
console
.
log
(
new
User
(
id
,
html
,
null
));
}
main
();
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