cineworld_uk 1.0.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +64 -0
  4. data/README.md +2 -1
  5. data/cineworld_uk.gemspec +3 -3
  6. data/lib/cineworld_uk/cinema.rb +60 -69
  7. data/lib/cineworld_uk/film.rb +25 -7
  8. data/lib/cineworld_uk/internal/film_with_screenings_parser.rb +29 -71
  9. data/lib/cineworld_uk/internal/name_parser.rb +20 -18
  10. data/lib/cineworld_uk/internal/screening_parser.rb +132 -0
  11. data/lib/cineworld_uk/internal/titleize.rb +19 -19
  12. data/lib/cineworld_uk/internal/website.rb +33 -0
  13. data/lib/cineworld_uk/internal/whatson_parser.rb +44 -0
  14. data/lib/cineworld_uk/screening.rb +65 -20
  15. data/lib/cineworld_uk/version.rb +2 -2
  16. data/lib/cineworld_uk.rb +4 -0
  17. data/test/fixture_updater.rb +64 -0
  18. data/test/fixtures/cinemas.html +134 -41
  19. data/test/fixtures/{cinemas/bury-st-edmunds.html → information/brighton.html} +488 -437
  20. data/test/fixtures/{cinemas → information}/bristol.html +463 -410
  21. data/test/fixtures/whatson/brighton/film_first.html +775 -0
  22. data/test/fixtures/whatson/brighton/film_last.html +52 -0
  23. data/test/fixtures/whatson/brighton/film_second.html +645 -0
  24. data/test/fixtures/whatson/brighton.html +3564 -2690
  25. data/test/fixtures/whatson/glasgow-imax-at-gsc/film_first.html +140 -0
  26. data/test/fixtures/whatson/the-o2-greenwich/film_first.html +1242 -0
  27. data/test/lib/cineworld_uk/cinema_test.rb +104 -301
  28. data/test/lib/cineworld_uk/film_test.rb +49 -2
  29. data/test/lib/cineworld_uk/internal/film_with_screenings_parser_test.rb +83 -81
  30. data/test/lib/cineworld_uk/internal/titleize_test.rb +12 -5
  31. data/test/lib/cineworld_uk/internal/website_test.rb +57 -0
  32. data/test/lib/cineworld_uk/internal/whatson_parser_test.rb +58 -0
  33. data/test/lib/cineworld_uk/screening_test.rb +155 -23
  34. data/test/lib/cineworld_uk/version_test.rb +1 -1
  35. data/test/test_helper.rb +3 -1
  36. metadata +30 -33
  37. data/test/fixtures/cinemas/brighton.html +0 -8
  38. data/test/fixtures/cinemas/chelsea.html +0 -1030
  39. data/test/fixtures/cinemas/glasgow-imax-at-gsc.html +0 -916
  40. data/test/fixtures/cinemas/the-o2-grenwich.html +0 -1191
  41. data/test/fixtures/whatson/brighton/gravity.html +0 -2129
  42. data/test/fixtures/whatson/glasgow-imax-at-gsc/the-hunger-games-catching-fire.html +0 -498
  43. data/test/fixtures/whatson/glasgow-imax-at-gsc-cinema.html +0 -3160
  44. data/test/fixtures/whatson/the-o2-greenwich/gravity.html +0 -784
  45. data/test/fixtures/whatson/the-o2-greenwich/the-hobbit-desolation-of-smaug.html +0 -764
  46. data/test/fixtures/whatson/the-o2-greenwich.html +0 -6854
  47. data/test/fixtures/whatson/wandsworth.html +0 -13729
@@ -2,28 +2,52 @@
2
2
  <!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
- <title>Cineworld Cinemas: Choose Your Local Cinema To See Film Times For The Latest Movies And 3D Performances In Your Area</title>
5
+ <title>Choose Your Local Cinema To See Film Times For The Latest Movies And 3D Performances In Your Area | Cineworld Cinemas</title>
6
6
 
7
7
  <meta charset="UTF-8" />
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
9
9
  <meta name="robots" content="index, follow" />
10
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
10
 
12
- <link type="image/x-icon" rel="shortcut icon" href="/cw/assets/favicon.ico" />
11
+ <meta name="viewport" content="user-scalable=yes, width=1280, minimum-scale=0.5, maximum-scale=3.0" />
12
+
13
+ <link rel="shortcut icon" type="image/x-icon" href="/cw/assets/favicon.ico" />
14
+ <link rel="icon" type="image/png" href="/cw/assets/favicon-196x196.png" sizes="196x196" />
15
+ <link rel="icon" type="image/png" href="/cw/assets/favicon-160x160.png" sizes="160x160" />
16
+ <link rel="icon" type="image/png" href="/cw/assets/favicon-96x96.png" sizes="96x96" />
17
+ <link rel="icon" type="image/png" href="/cw/assets/favicon-32x32.png" sizes="32x32" />
18
+ <link rel="icon" type="image/png" href="/cw/assets/favicon-16x16.png" sizes="16x16" />
19
+
20
+
21
+ <meta name="application-name" content="Cineworld Cinemas" />
22
+ <meta name="msapplication-tooltip" content="Cineworld Cinemas" />
23
+ <meta name="msapplication-starturl" content="http://www.cineworld.co.uk" />
24
+ <meta name="msapplication-task" content="name=Home; action-uri=http://www.cineworld.co.uk; icon-uri=http://www.cineworld.co.uk/cw/assets/favicon.ico;" />
25
+ <meta name="msapplication-task" content="name=What's On; action-uri=http://www.cineworld.co.uk/whatson; icon-uri=http://www.cineworld.co.uk/cw/assets/favicon.ico;" />
26
+ <meta name="msapplication-task" content="name=Our Cinemas; action-uri=http://www.cineworld.co.uk/cinemas; icon-uri=http://www.cineworld.co.uk/cw/assets/favicon.ico;" />
27
+ <meta name="msapplication-task" content="name=Explore Cineworld; action-uri=http://www.cineworld.co.uk/explore; icon-uri=http://www.cineworld.co.uk/cw/assets/favicon.ico;" />
28
+ <meta name="msapplication-task" content="name=Cineworld Blog; action-uri=http://www.cineworld.co.uk/blog; icon-uri=http://www.cineworld.co.uk/cw/assets/favicon.ico;" />
29
+ <meta name="msapplication-TileColor" content="#231f20" />
30
+ <meta name="msapplication-TileImage" content="/cw/assets/mstile-144x144.png" />
31
+ <meta name="msapplication-square70x70logo" content="/cw/assets/mstile-70x70.png" />
32
+ <meta name="msapplication-square144x144logo" content="/cw/assets/mstile-144x144.png" />
33
+ <meta name="msapplication-square150x150logo" content="/cw/assets/mstile-150x150.png" />
34
+ <meta name="msapplication-square310x310logo" content="/cw/assets/mstile-310x310.png" />
35
+ <meta name="msapplication-wide310x150logo" content="/cw/assets/mstile-310x150.png" />
36
+ <meta name="msapplication-notification" content="frequency=60; polling-uri=/syndication/tile_notifications_1_cw_gb.xml; polling-uri2=/syndication/tile_notifications_2_cw_gb.xml; polling-uri3=/syndication/tile_notifications_3_cw_gb.xml; polling-uri4=/syndication/tile_notifications_4_cw_gb.xml; polling-uri5=/syndication/tile_notifications_5_cw_gb.xml;" />
13
37
 
14
38
  <link type="text/css" rel="stylesheet" href="/cw/assets/css/bootstrap.packed.css" media="all" />
15
39
  <link type="text/css" rel="stylesheet" href="/cw/assets/css/jquery.fancybox.packed.css" media="all" />
16
40
  <link type="text/css" rel="stylesheet" href="/cw/assets/css/nivo.slider.packed.css" media="all" />
17
41
  <link type="text/css" rel="stylesheet" href="/cw/assets/css/nivo.slider.default.packed.css" media="all" />
18
42
  <link type="text/css" rel="stylesheet" href="/cw/assets/css/zebra.datepicker.packed.css" media="all" />
19
- <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld.typography.packed.css" media="all" />
20
- <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld.layout.packed.css" media="all" />
21
- <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld.print.packed.css" media="print" />
43
+ <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld-desktop-typography.packed.css" media="all" />
44
+ <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld-desktop.packed.css" media="all" />
45
+ <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld-print.packed.css" media="print" />
22
46
  <!--[if IE]>
23
- <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld.ie.packed.css" media="all" />
47
+ <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld-desktop-ie.packed.css" media="all" />
24
48
  <![endif]-->
25
49
  <!--[if lt IE 8]>
26
- <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld.ie7.packed.css" media="all" />
50
+ <link type="text/css" rel="stylesheet" href="/cw/assets/css/cineworld-desktop-ie7.packed.css" media="all" />
27
51
  <![endif]-->
28
52
 
29
53
  <script type="text/javascript" src="/cw/assets/javascript/log4j.packed.js"></script>
@@ -32,30 +56,77 @@
32
56
  <script type="text/javascript" src="/cw/assets/javascript/jquery.pseudo.packed.js"></script>
33
57
  <![endif]-->
34
58
 
35
- <!-- This comment replaces content that was removed due to user's cookie settings -->
59
+ <script type="text/javascript">
60
+ var _gaq = _gaq || [];
61
+ _gaq.push(['_setAccount', 'UA-35708014-1']);
62
+ _gaq.push(['_setDomainName', 'cineworld.co.uk']);
63
+ _gaq.push(['_trackPageview']);
64
+
65
+ (function () {
66
+ var ga = document.createElement('script');
67
+ ga.type = 'text/javascript';
68
+ ga.async = true;
69
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
70
+ var s = document.getElementsByTagName('script')[0];
71
+ s.parentNode.insertBefore(ga, s);
72
+ })();
73
+ </script>
36
74
 
37
75
 
38
76
 
39
77
  <meta name="Description" content="Cineworld Cinemas have digital screens across the UK: Choose your local cinema to see film times for the latest movies, 3D, IMAX and D-box performances in your area." />
40
78
  <meta name="Keywords" content="Cinemas, local cinema branches, local cinema listings, Film times, local multiplex" />
41
79
  <link rel="canonical" href="http://www.cineworld.co.uk/cinemas" />
80
+ <link rel="alternate" media="only screen and (max-width: 640px)" href=”http://www.cineworld.co.uk/mobile/cinemas" >
42
81
 
43
82
 
44
83
 
45
84
 
46
85
  <!-- cinwebprweb13.901e.sys.carrenza.net -->
47
86
 
48
- <!-- This comment replaces content that was removed due to user's cookie settings -->
87
+ <!-- Start Visual Website Optimizer Asynchronous Code -->
88
+ <script type='text/javascript'>
89
+ var _vwo_code=(function(){
90
+ var account_id=46415,
91
+ settings_tolerance=2000,
92
+ library_tolerance=2500,
93
+ use_existing_jquery=false,
94
+ // DO NOT EDIT BELOW THIS LINE
95
+ f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
96
+ </script>
97
+ <!-- End Visual Website Optimizer Asynchronous Code -->
49
98
  </head>
50
99
 
51
- <body class="cineworld gb cinema search">
100
+ <body class="cineworld gb web browser cinema search">
52
101
  <div id="fb-root"></div>
53
102
 
103
+ <div class="notification cookie" style="display: none;">
104
+ <div>
105
+ <h3 class="h1">Cookies Notification</h3>
106
+
107
+ <div class="text">
108
+ <p>This website uses cookies to provide you with a better experience.<br /><br />You can adjust your cookie settings at any time at the bottom of each page.&nbsp; If you do not adjust your settings, you are consenting to us issuing all cookies to you.<br /><br /></p>
109
+
110
+ <p>This notification will be automatically dismissed in <span class="remaining">15</span> seconds, <a class="dismiss">dismiss this countdown</a>.</p>
111
+ </div>
112
+
113
+ <div class="actions">
114
+ <p>
115
+ <a href="/cookies/settings">Change settings</a><br />
116
+ <a href="/cookies/about" target="_blank">Find out more about Cookies</a>
117
+ </p>
118
+ <p>
119
+ <a class="action primary">Continue</a>
120
+ </p>
121
+ </div>
122
+ </div>
123
+ </div>
124
+
54
125
  <div id="wallpaper">
55
126
 
56
127
  <div id="header" role="banner">
57
128
  <div class="container">
58
- <h1><a href="/">Cineworld Cinemas</a></h1>
129
+ <a class="brand" href="/">Cineworld Cinemas</a>
59
130
 
60
131
  <div class="account">
61
132
  <span class="icon-logo-mycineworld ">mycineworld</span>
@@ -74,7 +145,7 @@
74
145
  <li>
75
146
  <a href="/whatson">What's On</a>
76
147
  <ul>
77
- <li><a href="/events">Bollywood &amp; Live Events</a></li>
148
+ <li><a href="/events">Bollywood &amp; Event Cinema</a></li>
78
149
  <li><a href="/whatson/category/junior">Movies for Juniors</a></li>
79
150
  </ul>
80
151
  </li>
@@ -93,8 +164,12 @@
93
164
  <li><a href="/blog">Cineworld Blog</a></li>
94
165
  <li><a href="/competitions">Offers &amp; Competitions</a></li>
95
166
 
96
- <li><a href="/baftascotland">BAFTA Scotland</a></li>
97
- <li><a href="/take2">Take 2 Thursdays</a></li>
167
+ <li><a href="/bargain-tuesdays">Bargain Tuesdays</a></li>
168
+ <li><a href="/cineworld-foundation">Cineworld Foundation</a></li>
169
+ <li><a href="/summer-family-films-2014">Summer Family Films</a></li>
170
+ <li><a href="/mega-movies-2014">Mega Movies at Cineworld</a></li>
171
+ <li><a href="/take2">Take 2 Offer</a></li>
172
+ <li><a href="/baskin-robbins">Baskin Robbins at Cineworld</a></li>
98
173
  <li><a href="/starbucks">Starbucks at Cineworld</a></li>
99
174
  </ul>
100
175
  </li>
@@ -121,21 +196,21 @@
121
196
  </ul>
122
197
  </div>
123
198
 
124
- <div class="container" role="main">
199
+ <div class="container blockable" role="main">
125
200
 
126
201
  <!-- [SL] Site content layout -->
127
202
  <div class="layout">
128
203
  <div id="content" >
129
- <div class="section dark gradient clearfix ">
204
+ <div class="section dark gradient clearfix " >
130
205
  <h1>See what's showing at your local Cineworld Cinema</h1>
131
206
  </div>
132
- <div class="section light clearfix ">
207
+ <div class="section light clearfix " >
133
208
  <h1 class="ribbon">Which Cineworld Cinema's film times would you like to see?</h1>
134
209
 
135
210
 
136
211
  <div class="row">
137
212
  <div class="span12">
138
- <form class="validate auto-submit" id="form-choose" name="form-choose" method="post">
213
+ <form class="auto-submit" id="form-choose" name="form-choose" method="post">
139
214
 
140
215
  <label>
141
216
  <span>Choose a cinema:</span>
@@ -172,7 +247,6 @@
172
247
  <option value="88">Glasgow - IMAX at GSC</option>
173
248
  <option value="27">Glasgow - Parkhead</option>
174
249
  <option value="28">Glasgow - Renfrew Street</option>
175
- <option value="29">Gloucester</option>
176
250
  <option value="90">Gloucester Quays</option>
177
251
  <option value="31">Harlow</option>
178
252
  <option value="76">Haverhill</option>
@@ -214,9 +288,11 @@
214
288
  <option value="57">Solihull</option>
215
289
  <option value="58">Southampton</option>
216
290
  <option value="59">St Helens</option>
291
+ <option value="91">St Neots</option>
217
292
  <option value="61">Stevenage</option>
218
293
  <option value="62">Stockport</option>
219
294
  <option value="63">Swindon</option>
295
+ <option value="92">Telford</option>
220
296
  <option value="64">Wakefield</option>
221
297
  <option value="68">Weymouth</option>
222
298
  <option value="77">Witney</option>
@@ -224,7 +300,9 @@
224
300
  <option value="71">Yeovil</option>
225
301
  </select>
226
302
  </label>
303
+ </form>
227
304
 
305
+ <form class="validate" id="form-search" name="form-search" method="post">
228
306
  <label class="inline margin-right">
229
307
  <span>Search by town or postcode:</span>
230
308
  <input type="text" id="location" name="location" value="" placeholder='Town or postcode' />
@@ -299,7 +377,7 @@
299
377
 
300
378
 
301
379
  <div id="footer" role="contentinfo">
302
- <div class="section dark clearfix ">
380
+ <div class="section dark clearfix " >
303
381
 
304
382
  <div class="row">
305
383
 
@@ -343,7 +421,7 @@
343
421
 
344
422
  <h3>Cineworld apps</h3>
345
423
  <ul>
346
- <li><a href="http://itunes.apple.com/gb/app/cineworld/id377707014">iPhone app</a></li>
424
+ <li><a href="http://itunes.apple.com/gb/app/cineworld/id377707014?mt=8">iPhone app</a></li>
347
425
  <li><a href="https://play.google.com/store/apps/details?id=com.cineworld">Android app</a></li>
348
426
  <li><a href="http://itunes.apple.com/gb/app/cineworld-magazine/id508350271">iPad magazine</a></li>
349
427
  </ul>
@@ -354,7 +432,7 @@
354
432
 
355
433
  <div class="row">
356
434
  <div class="span12 smallprint small">
357
- <p>All rights reserved Cineworld Cinemas 2013 &copy;</p>
435
+ <p>All rights reserved Cineworld Cinemas 2014 &copy;</p>
358
436
  </div>
359
437
  </div>
360
438
 
@@ -371,22 +449,6 @@
371
449
  <p data-field="explanation" class="default">Booking is unavailable for this showtime as it may have already started, finished or been sold out.</p>
372
450
  </div>
373
451
 
374
- <div class="notification cookie" style="display: none;">
375
- <h1 class="">Cookies Notification</h1>
376
- <div>
377
- <p>This website uses cookies to provide you with a better experience.<br /><br />You can adjust your cookie settings at any time at the bottom of each page.&nbsp; If you do not adjust your settings, you are consenting to us issuing all cookies to you.<br /><br /></p>
378
- <p>
379
- <a href="/cookies/settings">Change settings</a><br />
380
- <a href="/cookies/about" target="_blank">Find out more about Cookies</a>
381
- </p>
382
- <p>
383
- <a class="action primary">No, thanks</a>
384
- </p>
385
-
386
- <p>This notification will be automatically dismissed in <span class="remaining">15</span> seconds, <a class="dismiss">dismiss this countdown</a>.</p>
387
- </div>
388
- </div>
389
-
390
452
  <script type="text/javascript" src="/cw/assets/javascript/jquery.blockui.packed.js"></script>
391
453
  <script type="text/javascript" src="/cw/assets/javascript/jquery.lazyload.packed.js"></script>
392
454
  <script type="text/javascript" src="/cw/assets/javascript/jquery.validate.packed.js"></script>
@@ -407,12 +469,43 @@
407
469
  <script type="text/javascript" src="/cw/assets/javascript/initialise.packed.js"></script>
408
470
 
409
471
 
410
- <!-- This comment replaces content that was removed due to user's cookie settings -->
472
+
473
+ <script type="text/javascript">
474
+ // WebTrends SmartSource Data Collector Tag v10.2.81
475
+ // Copyright (c) 2013 Webtrends Inc. All rights reserved.
476
+ // Tag Builder Version: 4.1.0.49
477
+ // Created: 2013.03.09
478
+ window.webtrendsAsyncInit=function(){
479
+ var dcs=new Webtrends.dcs().init({
480
+ dcsid:"dcskzgl9m000000w4dyp4senq_3i2w",
481
+ domain:"statse.webtrendslive.com",
482
+ timezone:0,
483
+ i18n:true,
484
+ adimpressions:true,
485
+ adsparam:"WT.ac",
486
+ offsite:true,
487
+ download:true,
488
+ downloadtypes:"xls,doc,pdf,txt,csv,zip,docx,xlsx,rar,gzip",
489
+ onsitedoms:"cineworld.co.uk",
490
+ fpcdom:"cineworld.co.uk"
491
+ }).track();
492
+ };
493
+ (function(){
494
+ var s=document.createElement("script"); s.async=true; s.src="/cw/assets/javascript/webtrends.packed.js";
495
+ var s2=document.getElementsByTagName("script")[0]; s2.parentNode.insertBefore(s,s2);
496
+ }());
497
+ </script>
498
+
499
+
500
+ <noscript>
501
+ <img alt="dcsimg" id="dcsimg" width="1" height="1" src="http://statse.webtrendslive.com/dcskzgl9m000000w4dyp4senq_3i2w/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=10.2.81&amp;dcssip=cineworld.co.uk&amp;" />
502
+ </noscript>
503
+
411
504
  <script type="text/javascript">
412
505
  //<![CDATA[
413
506
  (function() {
414
507
  var _analytics_scr = document.createElement('script');
415
- _analytics_scr.type = 'text/javascript'; _analytics_scr.async = true; _analytics_scr.src = '/_Incapsula_Resource?SWJIYLWA=2977d8d74f63d7f8fedbea018b7a1d05&ns=2';
508
+ _analytics_scr.type = 'text/javascript'; _analytics_scr.async = true; _analytics_scr.src = '/_Incapsula_Resource?SWJIYLWA=2977d8d74f63d7f8fedbea018b7a1d05&ns=1';
416
509
  var _analytics_elem = document.getElementsByTagName('script')[0]; _analytics_elem.parentNode.insertBefore(_analytics_scr, _analytics_elem);
417
510
  })();
418
511
  // ]]>