Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afeiship/next-weibo-to-pics

Sina weibo pics to array.
https://github.com/afeiship/next-weibo-to-pics

next pics weibo

Last synced: 22 days ago
JSON representation

Sina weibo pics to array.

Awesome Lists containing this project

README

        

# next-weibo-to-pics
> Sina weibo response to array.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
yarn add @jswork/next-weibo-to-pics
```

## usage
```js
import '@jswork/next-weibo-to-pics';

const options = { baseURL: 'https://tva1.sinaimg.cn' };
const html = `
document.domain="sina.com.cn";
{"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](https://github.com/afeiship/next-weibo-to-pics/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-weibo-to-pics
[version-url]: https://npmjs.org/package/@jswork/next-weibo-to-pics

[license-image]: https://img.shields.io/npm/l/@jswork/next-weibo-to-pics
[license-url]: https://github.com/afeiship/next-weibo-to-pics/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-weibo-to-pics
[size-url]: https://github.com/afeiship/next-weibo-to-pics/blob/master/dist/next-weibo-to-pics.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-weibo-to-pics
[download-url]: https://www.npmjs.com/package/@jswork/next-weibo-to-pics