Code Monkey home page Code Monkey logo

lending-tree-service's Introduction

Lending Tree Reviews Service

A simple service that allows a user to pass in a Lending Tree lender's url, and returns all the reviews for that lender. Built in python3 with Flask.

Installation

This service requires python3 to be installed on your machine.

  1. Clone this repo and navigate to the directory
  2. Create a virtual environment for packages:
    python3 -m venv venv
  3. Activate your virtual environment
    . ./venv/bin/activate
  4. Install the requirements
    pip install -r requirements.txt

Usage

Start the application with

python3 -m app

The server runs on localhost:5000.

Run tests with

python3 -m unittest discover ./test/ 

Making Requests

  1. Find your desired lender's URL on Lending Tree's website. https://www.lendingtree.com/reviews/personal/ has the list of available lenders.
  2. Make a GET request to localhost:5000/review/{lender_url}

Response

Responses are JSON formatted. An example response is as follows:

[
  {
    "id": "5e416ae37f520f0001508adc",
    "productId": "42825",
    "productType": "lender",
    "title": "It was a really good experience. ",
    "text": "It was so easy to complete the application and the get the money I needed. Very helpful. Thanks so much.",
    "isRecommended": true,
    "authorId": "",
    "authorEmail": "",
    "anonymousUId": "",
    "authorName": "Vicky",
    "userLocation": "GROTTOES, VA",
    "brandId": "42825",
    "lenderId": 81638970,
    "isAuthenticated": false,
    "isVerifiedCustomer": false,
    "socialSurveyReviewId": null,
    "votesUp": 0,
    "votesDown": 0,
    "isFlagged": false,
    "comments": null,
    "primaryRating": {
      "value": 4,
      "name": "Overallrating"
    },
    "secondaryRatings": [
      {
        "name": "RateRating",
        "value": 3.0
      },
      {
        "name": "FeesAndCostsRating",
        "value": 3.0
      },
      {
        "name": "ResponsivenessRating",
        "value": 5.0
      },
      {
        "name": "CustomerServiceRating",
        "value": 5.0
      }
    ],
    "properties": [
      {
        "name": "RequestType",
        "value": "Personal Loan"
      },
      {
        "name": "IsLoanClosed",
        "value": "true"
      }
    ],
    "submissionDateTime": "2020-02-10T09:38:26.509+00:00"
  }
]

Future Considerations

  • Persistent storage would likely be the most impactful addition to this project. After a lender is looked up once, we could store the brand_id that is used by Lending Tree's API. Then, for future lookups, we would not need to scrape that value from the webpage.
  • After storage is in place, a cron job could be run to keep the database of reviews and lenders up to date.
  • Docker would be a welcome addition to bundle the service.
  • Flask on it's own is not production-ready. Adding waitress would be a simple way to get the app ready for production.
  • As the API grows, Sphinx can be added to generate documentation. As there's only one route currently, a GitHub readme will suffice.

lending-tree-service's People

Contributors

j-hust 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.