Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
tools
Commits
6a778c43
Commit
6a778c43
authored
2 years ago
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ff
parent
befd3dca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
13 deletions
+30
-13
snow2east/js/index.js
+30
-13
No files found.
snow2east/js/index.js
View file @
6a778c43
var
host
=
"https://monitor-sentinel.mepai.me"
function
main
()
{
var
dom
=
$
(
"#app > div.container-lg.clearfix > div.container-sm.float-left.stock__main > div.stock-name"
);
var
stock
=
dom
.
text
();
...
...
@@ -12,9 +9,8 @@ function main() {
var
search
=
matches
[
0
];
search
=
search
.
replace
(
"("
,
""
);
search
=
search
.
replace
(
")"
,
""
);
search
=
search
.
replace
(
":"
,
""
);
var
a
=
document
.
createElement
(
"a"
);
a
.
href
=
"http://quote.eastmoney.com/"
+
search
.
toLowerCase
()
+
".html"
;
a
.
href
=
"http://quote.eastmoney.com/"
+
search
.
replace
(
":"
,
""
).
toLowerCase
()
+
".html"
;
a
.
target
=
"_blank"
;
a
.
innerText
=
stock
;
$
(
dom
).
html
(
$
(
a
));
...
...
@@ -30,19 +26,39 @@ function main() {
}
function
getInfo
(
code
,
callback
)
{
var
api
=
"/basic?code="
+
code
if
(
code
===
""
)
{
alert
(
"code error"
)
return
var
codes
=
code
.
split
(
":"
)
var
api
=
"https://api.tushare.pro"
;
var
exchange
=
codes
[
0
]
===
"SZ"
?
"SZSE"
:
"SSE"
;
var
data
=
{
"token"
:
"46879d4208e882e5578b24c9a063d24097879461e6c53e1036ecbb65"
,
"api_name"
:
"stock_basic"
,
"params"
:{
"ts_code"
:
codes
[
1
]
+
"."
+
codes
[
0
],
"exchange"
:
exchange
},
"fields"
:
"area,market"
}
fetch
(
host
+
api
).
then
(
res
=>
{
return
res
.
text
();
fetch
(
api
,
{
method
:
"post"
,
body
:
JSON
.
stringify
(
data
),
headers
:
{
"content-type"
:
"application/json"
}
}).
then
(
res
=>
{
var
data
=
JSON
.
parse
(
res
);
callback
(
data
.
data
.
market
)
return
res
.
text
()
}).
then
(
res2
=>
{
var
res
=
JSON
.
parse
(
res2
);
var
dom2
=
$
(
"#app > div.container-lg.clearfix > div.container-sm.float-left.stock__main > div.stock-issues"
);
var
box
=
document
.
createElement
(
"div"
);
var
box2
=
document
.
createElement
(
"div"
);
$
(
box
).
addClass
(
"stock-issue"
);
$
(
box2
).
addClass
(
"stock-issue"
);
var
data
=
res
.
data
.
items
[
0
]
box
.
innerText
=
"属地:"
+
data
[
0
];
box2
.
innerText
=
data
[
1
];
$
(
dom2
).
append
(
$
(
box
));
$
(
dom2
).
append
(
$
(
box2
));
}).
catch
(
e
=>
{
console
.
error
(
e
)
})
}
main
();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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