Git Product home page Git Product logo

walmart's Introduction

Walmart Api

CS 320 XML WVUP Fall 2016

Installing

To install, first you need to add this line in your package.json file under the dependencies

"walmart": "git+https://github.com/zroberts/walmart.git"

Next, run npm install and it should pull down the files and install them.

Setup Object

var walmart = require("walmart");

Setting API Key

walmart.setApi(<API KEY>);

##########

Searching

walmart.search(<searchObject>, function(err, res){
	
});

searchObject is a JSON Object, with searchTerm required, minPrice and maxPrice optional

EXAMPLE -

var searchObject = {
  searchTerm : 'Playstation',
  minPrice   : '100',
  maxPrice   : '200'
}

RETURN

will return an array of json object with the following fields

[
	{
		id: 	   <the product ID>,
		name:	   <the product name>,
		price:	   <msrp>,
		saleprice: <current price>,
		category:  <category parth from walmart>,
		url: 	   <URL to product on Walmart.com>,
		imageUrl:  <url for the medium-sized image>,
		provider:  <STATIC Walmart>,
		reviews:   <number out of 5, returns 0 if there are no reviews>,
		numReviews: <number of reviews that have been submited>,
		description: <description of the item>,
	}
]

To access the array -

resp[i].id
resp[i].namne
etc...

Full Example

var walmart = require('walmart');

walmart.setApi(<YOUR_API_KEY>);

var searchObject = {
	searchTerm : 'Playstation',
	minPrice: '25',
	maxPrice: '100'
}

walmart.search(searchObject, function(err, res){
	if(err){
		console.log(err);
	}else{
		console.log(res);
	}

});

walmart's People

Contributors

zroberts avatar

Watchers

James Cloos avatar  avatar

walmart's Issues

Project

Trying to get your project to work in our searching function, but for some reason it doesn't want to acknowledge the existence of your methods, etc. I have followed the steps in the readme to a T. But for some reason it says your 'Resp[i]' Array isn't defined.

This is bizarre, to say the least.

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.