This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch-retry'); | |
const iconv = require('iconv-lite'); | |
module.exports = async function (list) { | |
const response = await fetch('https://hq.sinajs.cn/list=' + list, { | |
method: 'GET', | |
headers: { | |
Referer: 'https://finance.sina.com.cn', | |
}, | |
retry: 3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch-retry'); | |
const iconv = require('iconv-lite'); | |
module.exports = async function (list) { | |
const response = await fetch('https://qt.gtimg.cn/q=' + list, { | |
retry: 3, | |
pause: 10000, | |
}); | |
const orignal = await response.arrayBuffer(); | |
const result = await iconv.decode(Buffer.from(orignal), 'gbk'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class Store extends ChangeNotifier { | |
static Store singleton = Store(); | |
Map<dynamic, dynamic> _state = {}; | |
Map<dynamic, dynamic> get state => _state; | |
void setState(Map<dynamic, dynamic> state) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sha256 = require('sha256'); | |
var baseUrl = 'http://127.0.0.1:8000'; | |
var securityKey = '****'; | |
var encryptSalt = '****'; | |
/** | |
* 纯js实现的ajax | |
* | |
* ```js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Title</title> | |
<meta name="description" content="description"> | |
<meta name="keywords" content="github,markdown"> |