GithubHelp home page GithubHelp logo

keeratsingh / bing-image-json Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 183 KB

This C# UWP solution demonstrates the URL retreival after JSON string parsing from the Bing Image of the Day API. Each line of code is well detailed in order to demonstrate the thinking behind using the method and better understanding.

Home Page: http://keerats.com/blog/2016/bing-image-api-json-csharp-uwp/

C# 100.00%

bing-image-json's Introduction

bing-Image-JSON

This C# UWP solution demonstrates the URL retreival after JSON string parsing from the Bing Image of the Day API.
Each line of code is well detailed in order to demonstrate the thinking behind using the method and better understanding.

Description

• Ability to specify the region and the number of images to retrieve
• Solution to parseURL from the JSON string retrieved from the Bing API
• Explored native and third-party ways to parse JSON in C# UWP
• Demonstrated parsing utilizing JsonObject using Windows.Data.Json
• Implemented different parsing techniques employing both JObject and JsonConvert.DeserializeObject using NewtonSoft Json.Net

Parsing Methods

Windows.Data.Json (JsonObject)
Newtonsoft.Json (JObject)
Newtonsoft.Json (DeserializeObject)

Screenshots

Alt text

Blog Post

Here is a link to the blog post explaining the source code in detail.

Bing JSON String

Given below is a sample JSON string that is retrieved when number of images are set to 2.

{
  "images": [
    {
      "startdate": "20160728",
      "fullstartdate": "201607280700",
      "enddate": "20160729",
      "url": "/az/hprichbg/rb/Castelluccio_EN-US14033484396_1920x1080.jpg",
      "urlbase": "/az/hprichbg/rb/Castelluccio_EN-US14033484396",
      "copyright": "Castelluccio in Monti Sibillini National Park, Italy (© Brian Jannsen/Alamy)",
      "copyrightlink": "http://www.bing.com/search?q=Castelluccio,+Umbria&form=hpcapt&filters=HpDate:%2220160728_0700%22",
      "wp": true,
      "hsh": "3e471d31e42b8319a63b4f3384ba6207",
      "drk": 1,
      "top": 1,
      "bot": 1,
      "hs": []
    },
    {
      "startdate": "20160727",
      "fullstartdate": "201607270700",
      "enddate": "20160728",
      "url": "/az/hprichbg/rb/Coot_EN-US11668116958_1920x1080.jpg",
      "urlbase": "/az/hprichbg/rb/Coot_EN-US11668116958",
      "copyright": "A Eurasian coot resting on one leg in Derbyshire, England (© Andrew Parkinson/Minden Pictures)",
      "copyrightlink": "http://www.bing.com/search?q=Eurasian+coot&form=hpcapt&filters=HpDate:%2220160727_0700%22",
      "wp": true,
      "hsh": "10fc89ef15cb10884646cdc1d78cd144",
      "drk": 1,
      "top": 1,
      "bot": 1,
      "hs": []
    }
  ],
  "tooltips": {
    "loading": "Loading...",
    "previous": "Previous image",
    "next": "Next image",
    "walle": "This image is not available to download as wallpaper.",
    "walls": "Download this image. Use of this image is restricted to wallpaper only."
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.