• Stars
    star
    238
  • Rank 163,765 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A RESTful API to fetch daily wallpaper from Bing.com

Bing Wallpaper API

A RESTful API to fetch daily wallpaper from Bing.com

Usage

API

Parameters

  • resolution The resolution of wallpaper image. 1920 is the default value, you can also use 1366 and 3840(4K resolution).
  • format The response format, can be json or image. If response format is set as image, you will be redirected to the wallpaper image directly.
  • image_format The format of the wallpaper image, available values are jpg or webp. The default value is jpg.
  • index The index of wallpaper, starts from 0. By default, 0 means to get today's image, 1 means to get the image of yesterday, and so on. Or you can specify it as random to choose a random index between 0 and 7.
  • mkt The region parameter, the default value is zh-CN, you can also use en-US, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA. You can also set it as random to choose the region randomly.

Example

  • Request
https://bing.biturl.top/?resolution=1920&format=json&index=0&mkt=zh-CN
  • Response
{
  "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 background image

You can also use this API to set CSS background image:

background-image: url(https://bing.biturl.top/?resolution=1920&format=image&index=0&mkt=zh-CN);
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;

Demo

https://biturl.top

https://github.com/TimothyYe/biturl/blob/master/screenshots/1.jpg?raw=true

Run with docker

Get the latest version of docker image:

docker pull timothyye/bing:latest

Start the container with the image name & tag (YYYYMMDD or latest), for example:

docker run -d --name=bing-wallpaper --restart=always -p 9000:9000 timothyye/bing:latest

For development

Build it

git clone https://github.com/TimothyYe/bing-wallpaper.git
make build

Run it

bw/bw run

More Repositories

1

godns

A dynamic DNS client tool supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
Go
1,347
star
2

skm

A simple and powerful SSH keys manager
Go
860
star
3

mydotfiles

All my dot configuration files.
Vim Script
383
star
4

ydict

Yet another command-line youdao dictionary for geeks!
Go
361
star
5

glance

一款基于命令行文本小说阅读工具,996与10107程序员摸鱼划水必备神器
Go
134
star
6

biturl

URL shortener service, powered by Go.
Go
116
star
7

k8s-offline

Offline installation package for kubernetes.
Shell
69
star
8

namebeta

A command line domain query tool.
Go
45
star
9

DynDNS

Dynamic DNS script tool, written by ruby.
Ruby
37
star
10

exchangerate

A command-line tool to query exchange rate.
Go
34
star
11

vim-tips-web

Source code for vim-tips.com, rewritten by Go.
Go
32
star
12

doom-emacs

My Doom Emacs configuration
YASnippet
24
star
13

bspwm-config

My bspwm configuration.
Shell
13
star
14

vim-tips

A vim plugin to show tips of vim in Vim editor.
Vim Script
10
star
15

gpool

A lightweight Goroutine pool.
Go
7
star
16

DailyVimTips

Vim tips app for iOS, powered by Swift.
Swift
7
star
17

vim-ydict

A Vim plugin for ydict
Vim Script
6
star
18

martini-paginate

A pagination plugin for go-martini web framework.
Go
3
star
19

minyx-lite-timothy

PHP
3
star
20

leetcode

My leetcode solutions by Go.
Go
2
star
21

iris-demo

Iris demo project.
Go
2
star
22

kbt

KBT 程序员键盘发烧社, an open source forum, forked from elixir-china.
Elixir
2
star
23

btc-api

Restful API for getting latest Bitcoin price
JavaScript
2
star
24

emacs

My GNU Emacs Configuration
1
star
25

alfred2-vimtips-workflow

Alfred 2 Workflow to get random vim tips from vim-tips.com
1
star