Git Product home page Git Product logo

friend's Introduction

"Make your own Friend"

API integration Using Guzzle in PHP

An individual project, where we were asked to creatively integrate API’s into a meaningful page or a service, or an app. This is a web application that allows user to select pretend virtual person by selecting country of origin and gender.

Home Page

The selected options are then passed as a parameter to external API, and returns a random user based on the selection. That API sends back additional information such as name, address, email, etc. I was able to only choose the information I like and display it appropriately.

When “friend” is generated and rendered on the page, user can click buttons to get randomly generated jokes or a random smart quote. I specifically set-up an API call to exclude inappropriate content, by passing additional parameters in my request.

Friend Page

While working on this project I expanded my knowledge of PHP programming language, by using classes, modules, and Guzzle library to fetch data from public API’s. I also learned how to extract specific data to be able to render it on the page. Another important lesson I have learned is to be able to get new data from API, without re-loading the page, making user experience better, and run application faster.

How to use this Application

  1. To run this application localy, you need to have PHP installed (https://www.php.net/manual/en/install.php)
  2. Get Composer and install it globally (https://getcomposer.org/)
  3. Create a new directory , and in the command line run composer require guzzlehttp/guzzle:~6.0
  4. This will create the composer.json it will load the composer repositories and update the dependancies it will also generate autoload files.
  5. Clone repository, do not replace existing files(created by Composer)
  6. To run the application open index.php on you localhost

Or visit live version at VitaliyBulyma.com/friend

friend's People

Contributors

vitaliybulyma avatar

Watchers

James Cloos 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.