The implementation of the beauty Picture Wall and the beauty picture wall. The beauty picture wall is implemented. the beauty picture wall uses Baidu's interface to obtain beautiful pictures and displays them on its own page in the form of a waterfall stream. Github Project address: githu beautiful pictures Wall implementation, beautiful pictures Wall implementation
Use Baidu's interface to get beautiful pictures and display them on your own page as a waterfall stream.
Github address: https://github.com/CraryPrimitiveMan/pretty
The final result is as follows:
Open Baidu pictures of beautiful channels, http://image.baidu.com/channel? C = % E7 % BE % 8E % E5 % A5 % B3 # % E7 % BE % 8E % E5 % A5 % B3
Open chrome debugging tool or firefox firebug tool, drag the scroll bar to the bottom, you can see the following request in the network:
The parameters are as follows:
Through analysis, we can infer and verify the meaning of the field. col indicates the channel, tag indicates all the beautiful women, or other tags (such as their content ), pn indicates the number of images starting from, and rn indicates the number of images obtained.
The return value is as follows:
Analyze the content in imgs and select the desired attributes. I am sure to use the desired URL.
In this way, we can use the PHP Curl to obtain beautiful pictures based on Baidu's API.
In php, you can write as follows:
'Image .baidu.com '); $ url = 'http: // image.baidu.com/data/imgs? Sort = 0 & pn = '. $ page * $ pageSize. '& rn = '. $ pageSize. '& col = beauty & tag = All & tag3 = & p = channel & from = 1'; $ response = Requests: get ($ url, $ options ); echo $ response-> body;?>
Where Requests is a php http request Library, address: http://requests.ryanmccue.info/
The beauty can also be replaced with other channels.
The next step is to display images and use a waterfall stream plug-in.
The final code is put on my Github, Project address: https://github.com/CraryPrimitiveMan/pretty
The col parameter on github is photography ~~
Recommended beautiful pictures and wallpapers
Wallpaper types include: PVC wallpaper, cloth-based PVC wallpaper, pure paper wallpaper, non-woven wallpaper, kaolin wallpaper, velvet fiber wallpaper, etc., or listen to the shopping guide and decoration of my house during the decoration of the master said, haha. My family used ripple-branded wallpaper for the background during the decoration. it was made of velvet fiber from Lily. it felt soft and three-dimensional. my family liked it very much.
Beautiful pictures. have you planted a wall ??
With what other terror drops, dropping Love and waiting for the results
Vivo uses Baidu's interface to get beautiful pictures and presents them to its own page in the form of waterfall streams. Github Project address: https: // githu...