anyroadcom / Prometheus

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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"

About

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.


Languages

Language:Ruby 96.0%Language:CSS 2.1%Language:JavaScript 2.0%