zoukankan      html  css  js  c++  java
  • Bing每日壁纸API

    懒人直接出图

    https://www.shadow-forum.com/api/bing/bing.php

    API

    相关参数

    • resolution 壁纸的分辨率. 1920 为默认值, 你也可以将其设置为 1366.
    • format API的调用返回格式, 值可以为 json 或者 image. 如果返回格式设置为 image, API会直接跳转请求到对应的图片地址.
    • index 壁纸的index,默认从0开始。由于Bing壁纸的图片每日更新,所以通过index值可以获取之前的图片。
    • mkt Bing壁纸的地区参数,默认为 zh-CN, 你也可以将其设置为 en-USja-JPen-AUen-UKde-DEen-NZen-CA

    调用示例

    • API请求
    1
    https://bing.biturl.top/?resolution=1920&format=json&index=0&mkt=zh-CN
    • 返回
    1
    2
    3
    4
    5
    6
    7
    {
    "start_date": "20181118",
    "end_date": "20181119",
    "url": "https://www.bing.com/az/hprichbg/rb/NarrowsZion_ZH-CN9686302838_1920x1080.jpg",
    "copyright": "锡安国家公园内的维尔京河,美国犹他州 (© Justinreznick/Getty Images)",
    "copyright_link": "http://www.bing.com/search?q=%E9%94%A1%E5%AE%89%E5%9B%BD%E5%AE%B6%E5%85%AC%E5%9B%AD\u0026form=hpcapt\u0026mkt=zh-cn"
    }

    CSS中设置背景图片

    可以使用此API直接在CSS中设置背景图片:

    1
    2
    3
    background-image: url(https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN);
    background-size: 100%;
    background-repeat: no-repeat;
  • 相关阅读:
    模板库
    LCT小结
    BZOJ1502: [NOI2005]月下柠檬树
    技术资料分享
    ORM介紹及ORM優點、缺點
    依賴注入入門——Unity(二)
    面向切面編程入門(一)
    依賴注入入門——Unity(一)
    WCF、.Net Remoting、Web Service概念及区别
    深入设计模式(四)——建造者模式
  • 原文地址:https://www.cnblogs.com/whatzblog/p/13321606.html
Copyright © 2011-2022 走看看