All Projects → grubersjoe → bing-daily-photo

grubersjoe / bing-daily-photo

Licence: MIT license
A simple PHP class to fetch Bing's photo of the day.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to bing-daily-photo

Eazydict
简单易用的命令行词典 📕 📙 📗 📘 📓
Stars: ✭ 92 (+170.59%)
Mutual labels:  bing
Msmarco
Utilities, Baselines, Statistics and Descriptions Related to the MSMARCO DATASET
Stars: ✭ 175 (+414.71%)
Mutual labels:  bing
txt2speech
Convert text to speech using Google Translate API
Stars: ✭ 38 (+11.76%)
Mutual labels:  bing
Bingpaper
Use Bing daily photo as your wallpaper for macOS.
Stars: ✭ 105 (+208.82%)
Mutual labels:  bing
Bing Wallpaper
必应每日超清壁纸(4K)
Stars: ✭ 139 (+308.82%)
Mutual labels:  bing
Jsearch
jSearch(聚搜) 是一款专注内容的chrome搜索扩展,一次搜索聚合多平台内容。
Stars: ✭ 193 (+467.65%)
Mutual labels:  bing
Xinahn Socket
一个开源,高隐私,自架自用的聚合搜索引擎。 https://xinahn.com
Stars: ✭ 77 (+126.47%)
Mutual labels:  bing
Awesome-meta-tags
📙 Awesome collection of meta tags
Stars: ✭ 18 (-47.06%)
Mutual labels:  bing
Osmdeepod
OSMDeepOD - OpenStreetMap (OSM) and Machine Learning (Deep Learning) based Object Detection from Aerial Imagery (Formerly also known as "OSM-Crosswalk-Detection").
Stars: ✭ 174 (+411.76%)
Mutual labels:  bing
Sitedorks
Search Google/Bing/Ecosia/DuckDuckGo/Yandex/Yahoo for a search term with a default set of websites, bug bounty programs or a custom collection.
Stars: ✭ 221 (+550%)
Mutual labels:  bing
Bingmapsv8codesamples
This is a collection of over two hundred code samples an growing for the Bing Maps V8 web control.
Stars: ✭ 111 (+226.47%)
Mutual labels:  bing
Bingmapsresttoolkit
This is a portable class library which makes it easy to access the Bing Maps REST services from .NET.
Stars: ✭ 136 (+300%)
Mutual labels:  bing
Idt
Image Dataset Tool (idt) is a cli tool designed to make the otherwise repetitive and slow task of creating image datasets into a fast and intuitive process.
Stars: ✭ 202 (+494.12%)
Mutual labels:  bing
Bing
Bing 壁纸 API
Stars: ✭ 1,325 (+3797.06%)
Mutual labels:  bing
uranus
[W.I.P] An ecosystem of crawlers for detecting: leaks, sensitive data exposure and attempts exfiltration of data
Stars: ✭ 22 (-35.29%)
Mutual labels:  bing
Image search
Python Library to download images and metadata from popular search engines.
Stars: ✭ 86 (+152.94%)
Mutual labels:  bing
Bing Upyun
轻量必应每日一图API,支持上传至又拍云调用,支持图片处理(高斯模糊、灰阶),支持回溯。
Stars: ✭ 179 (+426.47%)
Mutual labels:  bing
bing-wallpaper
Python Skript that sets the daily www.bing.com picture as a Desktop Wallpaper
Stars: ✭ 21 (-38.24%)
Mutual labels:  bing
react-leaflet-bing
Bing layer as React component for Leaflet | This repo is obsolete. Plz, use https://github.com/TA-Geoforce/react-leaflet-bing
Stars: ✭ 13 (-61.76%)
Mutual labels:  bing
Search Engine Parser
Lightweight package to query popular search engines and scrape for result titles, links and descriptions
Stars: ✭ 216 (+535.29%)
Mutual labels:  bing

Bing Daily Photo

CI

BingPhoto is a simple PHP class to fetch Bing's image of the day with meta data.

It is also possible to cache the images locally, which can be useful in combination with a periodic cronjob. See the cacheDir parameter for this (optional) feature. Disclaimer: this might be a copyright issue.

Installation

Use Composer to install this package:

composer require grubersjoe/bing-daily-photo

Basic usage

<?php
$bing = new BingPhoto();
$image = $bing->getImage();

// Example result ($image)
[
    [startdate] => '20160913'
    [fullstartdate] => '201609130700'
    [enddate] => '20160914'
    [url] => 'http://www.bing.com/az/hprichbg/rb/Meteora_EN-US6763889417_1920x1080.jpg'
    [urlbase] => '/az/hprichbg/rb/Meteora_EN-US6763889417'
    [copyright] => 'Roussanou and other monasteries in Metéora, Greece (© Stian Rekdal/Nimia)'   
    // ...
]

Parameters / options

Parameter Description Default Valid values
cacheDir Directory for image caching null An existing directory, otherwise the directory will be created if possible
date Date of photo BingPhoto::DATE_TODAY BingPhoto::DATE_YESTERDAY
BingPhoto::DATE_TODAY
BingPhoto::DATE_TOMORROW
any integer >= -1
locale Locale code Locale::getDefault() Whatever language Bing supports
n Number of photos to fetch, going from date backwards 1 1 - 8
orientation Image orientation BingPhoto::ORIENTATION_LANDSCAPE BingPhoto::ORIENTATION_LANDSCAPE, BingPhoto::ORIENTATION_PORTRAIT
quality Image resolution BingPhoto::QUALITY_HIGH BingPhoto::QUALITY_LOW
BingPhoto::QUALITY_HIGH

Examples

// Fetches two images of the day starting yesterday from Bing
$bing = new BingPhoto([
    'n' => 2,
    'date' => BingPhoto::YESTERDAY
]);

foreach ($bing->getImages() as $image) {
    printf('<img src="%s">', $image['url']);
}
// Fetches the current image of the day in low resolution from the French Bing portal
$bing = new BingPhoto([
    'locale' => 'fr-FR',
    'quality' => BingPhoto::QUALITY_LOW,
]);

printf('<img src="%s">', $bing->getImage()['url']);
// Fetches three images of the day in high quality from the German Bing portal, starting yesterday
$bing = new BingPhoto([
    'n' => 3,
    'date' => BingPhoto::YESTERDAY,
    'locale' => 'de-DE',
    'quality'r => BingPhoto::QUALITY_HIGH,
]);

foreach ($bing->getImages() as $image) {
    printf('<img src="%s">', $image['url']);
}
// Fetches the current image of the day in portrait orientation
$bing = new BingPhoto([
    'orientation' => BingPhoto::ORIENTATION_PORTRAIT
]);
// Using the local cache 
$bing = new BingPhoto([
    'cacheDir' => '/tmp/bing-photo',
    'n' => 5,
    'quality' => BingPhoto::QUALITY_LOW,
]);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].