0.0.5 • Published 6 years ago
qzone-api v0.0.5
Qzone API
Install
yarn add qzone-api
Usage
const QzoneApi = require('qzone-api')
;(async () => {
const { user, cookies } = await QzoneApi.login(
'your account',
'your password'
)
// Get user information
console.log(user) // { login: true, owner: true, token: 'xxx' }
const p_uin = cookies.find(x => x.name === 'p_uin').value
const p_skey = cookies.find(x => x.name === 'p_skey').value
// Get all albums for this user
const { vFeeds } = await QzoneApi.getAlbumList({
p_uin,
p_skey,
g_tk: token,
res_uin: '1542262366'
})
// Get the first 200 photos in 1542262366's first album
const { photos, total_count } = await QzoneApi.getPhotoList({
p_uin,
p_skey,
g_tk: token,
uin: '1542262366',
albumid: vFeeds[0].pic.albumid
})
// Get the total number of photos
console.log(total_count)
// Get all the picture address
console.log(
[].concat(...Object.values(photos).map(x => x.map(x => x[1].url)))
)
})()
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
Qzone API © u3u, Released under the MIT License. Authored and maintained by u3u with help from contributors (list).