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
MyCard
ygopro-cn-database-generator
Commits
1dcc1eaf
Commit
1dcc1eaf
authored
Oct 21, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use CNOCG fetcher
parent
06c758c2
Pipeline
#942
passed with stages
in 1 minute and 28 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
run.ts
run.ts
+2
-1
src/cnocg.ts
src/cnocg.ts
+19
-0
No files found.
run.ts
View file @
1dcc1eaf
import
{
DBReader
}
from
"
./src/dbreader
"
;
import
{
NWFetcher
}
from
"
./src/nwfetcher
"
;
import
_
from
"
underscore
"
;
import
{
CNOCGFetcher
}
from
"
./src/cnocg
"
;
async
function
main
()
{
const
dbreader
=
new
DBReader
({
name
:
"
Database
"
,
level
:
"
debug
"
});
await
dbreader
.
init
();
const
cards
=
await
NWFetcher
.
fetchOnce
(
dbreader
);
const
cards
=
await
CNOCGFetcher
.
fetchOnce
(
);
await
dbreader
.
run
(
cards
);
process
.
exit
();
}
...
...
src/cnocg.ts
0 → 100644
View file @
1dcc1eaf
import
Base
from
"
./base
"
;
import
axios
from
"
axios
"
;
import
{
Card
}
from
"
./dbreader
"
;
export
class
CNOCGFetcher
extends
Base
{
static
async
fetchOnce
()
{
const
fetcher
=
new
CNOCGFetcher
({
name
:
"
Temp NW Fetcher
"
});
await
fetcher
.
init
();
return
await
fetcher
.
fetch
();
}
async
fetch
():
Promise
<
Card
[]
>
{
this
.
log
.
debug
(
`Started fetching from CNOCG source...`
);
const
allCardStrings
:
string
[]
=
(
await
axios
.
get
(
"
https://api.tcgcardgame.com/api/cards/sc
"
,
{
responseType
:
"
json
"
})).
data
;
const
allCards
=
allCardStrings
.
map
(
m
=>
new
Card
(
parseInt
(
m
)));
return
allCards
;
}
}
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