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
9593fdee
Commit
9593fdee
authored
Jul 02, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore ssl cert
parent
ff610fe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/cnocg.ts
src/cnocg.ts
+12
-2
No files found.
src/cnocg.ts
View file @
9593fdee
import
Base
from
"
./base
"
;
import
axios
from
"
axios
"
;
import
axios
,
{
AxiosInstance
}
from
"
axios
"
;
import
{
Card
}
from
"
./dbreader
"
;
import
{
Agent
}
from
"
https
"
;
export
class
CNOCGFetcher
extends
Base
{
static
async
fetchOnce
()
{
...
...
@@ -8,9 +9,18 @@ export class CNOCGFetcher extends Base {
await
fetcher
.
init
();
return
await
fetcher
.
fetch
();
}
axiosInstance
:
AxiosInstance
;
async
init
()
{
await
super
.
init
();
this
.
axiosInstance
=
axios
.
create
({
httpsAgent
:
new
Agent
({
rejectUnauthorized
:
false
})
})
}
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
"
,
{
const
allCardStrings
:
string
[]
=
(
await
this
.
axiosInstance
.
get
(
"
https://api.tcgcardgame.com/api/cards/sc
"
,
{
responseType
:
"
json
"
})).
data
;
const
allCards
=
allCardStrings
.
map
(
m
=>
new
Card
(
parseInt
(
m
)));
...
...
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