Code Monkey home page Code Monkey logo

google-shopping-conditionals-loops's Introduction

Google Shopping - Conditionals and Loops

We'll be using a file represented as JSON for this assignment. JSON is a standard for formatting data, and it's a common format you'll see throughout your web development career. Even more important will be parsing JSON.

This large object is in the products js file. It is the kind of object you would really recieve from google shopping.

Getting Started

Create a script.js file and an index.html file with the same boiler plate code as before.

Make sure the products.js file is in that directory.

In the html file, include the script products.js. Remember that the order of the script tags matters.

Hint

It's very important to understand the structure of the products object. Use the console to look at this object. When you type the product variable into the console, it becomes interactive.

Paste in the code that can access certain parts of the object and see what values, if any, you get out.

Example cats[1].allergies[6] - if you don't see anything back up- try the thing above: cats[1].allergies

Deliverables

Use the product search result in your file to find the following results.

Note that you may want to comment out your solutions as you solve them, to avoid a mess of output in the console.

  • Go through the items and find all results that have kind of shopping#product. Print the count of these results. Where else is this count information stored in the search results?

  • Print the title of all items with a backorder availability in inventories.

  • Print the title of all items with more than one image link.

  • Print all "Canon" products in the items (careful with case sensitivity).

  • Print all items that have an author name of "eBay" and are brand "Canon".

  • Print all the products with their brand, price, and an image link

Further:

Prompt the user for the product brand and print only those products.

Prompt the user if they want to see only new or used items.

Further:

Prompt the user what kind of search they want to do- search by brand or search by condition.

Then prompt the user to put in ther actual search value- (new/used for condition or brand name for brand)

Further:

Print out some special error text (e.g. "Sorry, nothing found") if there were no results.

Hints


Licensing

  1. All content is licensed under a CC-BY-NC-SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

google-shopping-conditionals-loops's People

Contributors

awongh avatar bhague1281 avatar nickangtc avatar primaulia avatar

Watchers

 avatar  avatar  avatar

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.