Skip to content

purkayasta/BingWallpaper

Repository files navigation

Bing Wallpaper API

Give it a star if you like the project. 👏 🌠 🌟

BingWallpaper API is for you to download bing daily wallpaper at ease.

Nuget Nuget Nuget Nuget

Give it a go from Nuget

Invoke:

To Use this library your friend will be this interface IBingWallpaperService.

instantiation

Two ways of getting the instance

  • Factory: BingWallpaperService.CreateService()

OR

  • Service Collection Extension services.AddBingWallpaper()

Usage:

Console APP:

var bingWallpaper = BingWallpaperInstaller.CreateService();
var source = bingWallpaper.GetDailyWallpaperInfo(15);

foreach (var imageUrl in source)
{
	Console.WriteLine($"Title: {imageUrl.Title}");
	bingWallpaper.Download(imageUrl.Url!, imageUrl.Title!.Trim(), "png", "D://");
}

Web App / API

public Controller {
	private readonly IBingWallpaperService _service;

	Controller(IBingWallpaperService service) => _service = service;

	[HttpGet()]
	public async Task<IActionResult> GetWallpaperSource(int count){
		var source = await bingWallpaper.GetDailyWallpaperInfoAsync(count);
		return OK(source);
	}

}

Made ❤ with C#.