From c94eee7f92d9cc027e6ca37b36f74bf914ff271c Mon Sep 17 00:00:00 2001 From: Janet Date: Mon, 6 Feb 2017 11:02:11 -0500 Subject: [PATCH] feat: cinema blend parser (#105) * feat: cinema blend parser all systems go * fix: timezone --- .../www.cinemablend.com/1482432215722.html | 1 + src/extractors/custom/index.js | 1 + .../custom/www.cinemablend.com/index.js | 47 ++++++++++ .../custom/www.cinemablend.com/index.test.js | 87 +++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 fixtures/www.cinemablend.com/1482432215722.html create mode 100644 src/extractors/custom/www.cinemablend.com/index.js create mode 100644 src/extractors/custom/www.cinemablend.com/index.test.js diff --git a/fixtures/www.cinemablend.com/1482432215722.html b/fixtures/www.cinemablend.com/1482432215722.html new file mode 100644 index 000000000..73b66aa69 --- /dev/null +++ b/fixtures/www.cinemablend.com/1482432215722.html @@ -0,0 +1 @@ + To 3D Or Not To 3D: Buy The Right Passengers Ticket - CINEMABLEND
Passengers Chris Pratt Jennifer Lawrence

What happens when you put two beautiful people together in the black of space? That's the question Passengers is setting out to answer, and unsurprisingly enough, some showings will be doing just that with 3D screenings. Which means more questions will arise around why such a platform would be included, chiefly among them a favorite of ours: "To 3D, or Not To 3D?" After all, what potential blockbuster would be complete without an excuse for facial furniture?

Just to be clear, we won't be reviewing the movie itself, so if you're looking for more talk about the actual content of the film, take a look at our official review here. Instead, we'll be looking at whether Passengers is worth the extra ticket money for 3D, or if you'd be better off tipping Arthur, the android bartender aboard the Starship Avalon. Prepare to board our latest 3D evaluation, as we look at how Passengers spends its 3D budget.

3D Fit Score
3/5

While there's a good number of visuals that could be served well by a 3D presentation, Passengers is made up of a lot of close-up/personal drama. To be honest, the third dimension isn't exactly the best fit for this film, though there do seem to be sequences and elements that were included and tweaked in order to make the film more visually exciting. As such, we'll give it a passing score, but let it be known that this is pretty low in comparison to most sci-fi blockbusters.

Planning & Effort Score
2/5

To be completely honest, the 3D on Passengers seems more like a grab for easy cash than an actual storytelling element. Throughout the various pieces of the film's presentation, there are some shortcomings that manage to hamper the post-conversion efforts. Even worse is the fact that the 3D somehow makes the green screen elements of this film stick out even more, as they don't blend in as well with the rest of the picture. It may have been planned out from the beginning to be released with the extra dimension, but it also isn't very well utilized.

Before the Window Score
2/5

There are very few moments where Passengers decides to throw items out at the audience over the course of its near-two hour runtime. But even when the film goes to those lengths, it manages to fall short, as the projectiles seem to streak off towards the side of the audiences' line of sight as opposed to right in our laps. Nothing really sticks out at the audience, except for the zero-g pool sequence, which culminates in water literally being thrown at the camera. It's a cool effect, but doesn't exactly deserve a high score on our meter.

Beyond the Window Score
3/5

When it comes to depth in 3D, there's a pronounced difference between the good and the bad. Passengers is decent, as it does manage to give us some deep images throughout a majority of the film - particularly when it comes to demonstrating the depth of space. As noted earlier, however, the up close and personal nature of the film and the narrative doesn't do the extra dimension any favors, as a lot of the depth is ignorable as the story and the camera focuses on the characters played by Jennifer Lawrence and Chris Pratt.

Brightness Score
4/5

One thing Passengers manages to actually get right is its brightness. While it's still a bit dim at times - an effect of the glasses audiences are forced to wear for the technology to function - it manages not to go too dark with its picture. Even with power surges, the dark and colorful depths of space, and some rich colors spread throughout the bright and stark environment of the Avalon, Passengers is still watchable. Admittedly this element of the 3D will change from theater to theater, as different places use their projectors differently, but I had a positive experience with the brightness of Passengers.

Glasses Off Score
3/5

When watching a 3D movie, if you take off your glasses and see a good amount of blur on the screen, it typically suggests a decent level of depth and detail with the images being presented (the blurriness attributed to the image layering that makes 3D work). Passengers has a lot of moments between its central characters that confine the blurry elements to the backgrounds and CGI additions to the image. This leaves certain sections of the film without any blurred elements on the forefront, especially with the characters of Jim and Aurora. Other films might take this opportunity to give facial features a chance to stand out, but sadly Passengers does not.

Audience Health Score
4/5

There isn't a lot of wonkiness in Passengers' 3D, but when it happens, it tends to mess with your eyes. There's a little bit of strain on the eye, which could be in part because of the depth effects being limited to mostly background elements of the film's presentation. For the most part though, the conversion isn't too horrible on the eyes, and there's no nausea to speak of, so it gets a passing grade in this department.

Blended From Around The Web

\ No newline at end of file diff --git a/src/extractors/custom/index.js b/src/extractors/custom/index.js index c803d6636..933c30320 100644 --- a/src/extractors/custom/index.js +++ b/src/extractors/custom/index.js @@ -52,6 +52,7 @@ export * from './uproxx.com'; export * from './www.eonline.com'; export * from './www.miamiherald.com'; export * from './www.refinery29.com'; +export * from './www.cinemablend.com'; export * from './www.al.com'; export * from './www.thepennyhoarder.com'; export * from './www.westernjournalism.com'; diff --git a/src/extractors/custom/www.cinemablend.com/index.js b/src/extractors/custom/www.cinemablend.com/index.js new file mode 100644 index 000000000..8fc07dafb --- /dev/null +++ b/src/extractors/custom/www.cinemablend.com/index.js @@ -0,0 +1,47 @@ +export const WwwCinemablendComExtractor = { + domain: 'www.cinemablend.com', + + title: { + selectors: [ + '.story_title', + ], + }, + + author: { + selectors: [ + '.author', + ], + }, + + date_published: { + selectors: [ + ['meta[name="article:published_time"]', 'value'], + ], + + timezone: 'EST', + }, + + lead_image_url: { + selectors: [ + ['meta[name="og:image"]', 'value'], + ], + }, + + content: { + selectors: [ + 'div#wrap_left_content', + ], + + // Is there anything in the content you selected that needs transformed + // before it's consumable content? E.g., unusual lazy loaded images + transforms: { + }, + + // Is there anything that is in the result that shouldn't be? + // The clean selectors will remove anything that matches from + // the result + clean: [ + + ], + }, +}; diff --git a/src/extractors/custom/www.cinemablend.com/index.test.js b/src/extractors/custom/www.cinemablend.com/index.test.js new file mode 100644 index 000000000..d25adc1c4 --- /dev/null +++ b/src/extractors/custom/www.cinemablend.com/index.test.js @@ -0,0 +1,87 @@ +import assert from 'assert'; +import fs from 'fs'; +import URL from 'url'; +import cheerio from 'cheerio'; + +import Mercury from 'mercury'; +import getExtractor from 'extractors/get-extractor'; +import { excerptContent } from 'utils/text'; + +describe('WwwCinemablendComExtractor', () => { + describe('initial test case', () => { + let result; + let url; + beforeAll(() => { + url = + 'http://www.cinemablend.com/news/1602870/to-3d-or-not-to-3d-buy-the-right-passengers-ticket'; + const html = + fs.readFileSync('./fixtures/www.cinemablend.com/1482432215722.html'); + result = + Mercury.parse(url, html, { fallback: false }); + }); + + it('is selected properly', () => { + // This test should be passing by default. + // It sanity checks that the correct parser + // is being selected for URLs from this domain + const extractor = getExtractor(url); + assert.equal(extractor.domain, URL.parse(url).hostname); + }); + + it('returns the title', async () => { + // To pass this test, fill out the title selector + // in ./src/extractors/custom/www.cinemablend.com/index.js. + const { title } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(title, 'To 3D Or Not To 3D: Buy The Right Passengers Ticket'); + }); + + it('returns the author', async () => { + // To pass this test, fill out the author selector + // in ./src/extractors/custom/www.cinemablend.com/index.js. + const { author } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(author, 'Mike Reyes'); + }); + + it('returns the date_published', async () => { + // To pass this test, fill out the date_published selector + // in ./src/extractors/custom/www.cinemablend.com/index.js. + const { date_published } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(date_published, '2016-12-22T02:46:48.000Z'); + }); + + it('returns the lead_image_url', async () => { + // To pass this test, fill out the lead_image_url selector + // in ./src/extractors/custom/www.cinemablend.com/index.js. + const { lead_image_url } = await result; + + // Update these values with the expected values from + // the article. + assert.equal(lead_image_url, 'http://img.cinemablend.com/quill/6/a/4/e/4/0/6a4e40e4aad46eb7b27810ce5a9fccff01c03c19.jpg'); + }); + + it('returns the content', async () => { + // To pass this test, fill out the content selector + // in ./src/extractors/custom/www.cinemablend.com/index.js. + // You may also want to make use of the clean and transform + // options. + const { content } = await result; + + const $ = cheerio.load(content || ''); + + const first13 = excerptContent($('*').first().text(), 13); + + // Update these values with the expected values from + // the article. + assert.equal(first13, 'What happens when you put two beautiful people together in the black of'); + }); + }); +});