@jswork/next-weibo-to-pics

1.1.2 • Public • Published

next-weibo-to-pics

Sina weibo response to array.

version license size download

installation

yarn add @jswork/next-weibo-to-pics

usage

import '@jswork/next-weibo-to-pics';

const options = { baseURL: 'https://tva1.sinaimg.cn' };
const html = `<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">document.domain="sina.com.cn";</script>
{"code":"A00006","data":{"count":1,"data":"eyJ1aWQiOjM2NjE4MzI4MDMsImFwcCI6Im1pbmlibG9nIiwiY291bnQiOjEsInRpbWUiOjE2MjA4ODIyNTQuNTMzLCJwaWNzIjp7InBpY18xIjp7IndpZHRoIjoyMDAsInNpemUiOjkzODksInJldCI6MSwiaGVpZ2h0IjoyMDAsIm5hbWUiOiJwaWNfMSIsInBpZCI6ImRhNDMyMjYzZ3kxZ3FncHUzdTBhbWoyMDVrMDVrM3loIn19fQ==","pics":{"pic_1":{"width":200,"size":9389,"ret":1,"height":200,"name":"pic_1","pid":"da432263gy1gqgpu3u0amj205k05k3yh"}}}}`;

const items = nx.weiboToPics(html, options);
/*
[
  {
    width: 200,
    size: 9389,
    ret: 1,
    height: 200,
    name: 'pic_1',
    pid: 'da432263gy1gqgpu3u0amj205k05k3yh',
    format: 'jpg',
    url: 'https://tva1.sinaimg.cn/large/da432263gy1gqgpu3u0amj205k05k3yh.jpg'
  }
]
*/

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/next-weibo-to-pics

Homepage

js.work

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

6.82 kB

Total Files

6

Last publish

Collaborators

  • afeiship