Code Monkey home page Code Monkey logo

anyroadcom / prometheus Goto Github PK

View Code? Open in Web Editor NEW
0.0 36.0 0.0 160 KB

Titan! to whom immortal eyes The sufferings of mortality Seen in their sad reality, Were not as things that gods despise; What was thy pity's recompense? A silent suffering, and intense; The rock, the vulture, and the chain, All that the proud can feel of pain, The agony they do not show, The suffocating sense of woe, Which speaks but in its loneliness, And then is jealous lest the sky Should have a listener, nor will sigh Until its voice is echoless.

Ruby 95.97% JavaScript 1.98% CSS 2.05%

prometheus's Introduction

Prometheus

Prometheus parses 5 ๐ŸŒŸ Tripadvisor Reviews, calculates a score based on selected Adjectives and draws an Image which is uploaded to S3.

Calculating the score is still really immature but will improve with time.

Parser

# Parses All 5โ˜… reviews
# @return [Hash] First Page Reviews
Parser::AllReviews.new(guide: g).parse

# Calculates Top Review 
# @return [Struct] Top Review
Parser::TopReview.new(guide: g).parse

# Creates Image from Review
# @return [String] Url for image on S3 bucket
Parser::CreateImage.new(review).parse

Endpoint

Issuing a POST request to the api/get_image endpoint will trigger the parser. Once the whole process is completed it will issue a callback with the selected Review containing the Image url.

The Request takes 2 params:

  • anyguide_id : The id of the Guide
  • trip_url : The Tripadvisor url of the Guide's Page

Playground โœจ

Set up Env's from your AWS Credentials:

  • ENV['PROMETHEUS_AKID']: AWS access key id
  • ENV['PROMETHEUS_SECRET'] AWS Secret key
$ curl -X POST -H 'Content-Type: application/json' "http://localhost:3000/api/get_image?anyguide_id=123&trip_url=http://www.tripadvisor.com/Attraction_Review-g3174148-d3613903-Reviews-Chania_Diving_Center-Kounoupidiana_Chania_Prefecture_Crete.html"

prometheus's People

Contributors

theminijohn avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.