Coder Social home page Coder Social logo

httpjsonfilter's Introduction

Coding Challenge solution

This is the code referenced in this video.

It's a POC for the usage of Collections and Iterators in PHP.

Run

There are two entry point scripts within this project:

  1. output_json.php
  2. run.php

The first is just an auxiliary script used to simulate a remote webservice. In order for the demo to work there should be a webserver running this script.

Use the following command to get it setup locally:

php -S localhost:8007 output_json.php

The second is the actual script that implements the filtering logic.

To get the expected result use a command with the following structure:

OFFERS_ENDPOINT=http://localhost:8007 php run.php SUBCOMMAND PARAM1 PARAM2 ... PARAMN

Available sub-commands are:

  • count_by_vendor_id
  • count_by_price_range

Examples:

OFFERS_ENDPOINT=http://localhost:8007 php run.php count_by_vendor_id 35
OFFERS_ENDPOINT=http://localhost:8007 php run.php count_by_price_range 5 20

httpjsonfilter's People

Contributors

mchojrin avatar alexkart avatar

Stargazers

Dave avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

alexkart

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.