GFunk911-imdb-tv 1.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.
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 0
3
+ :patch: 0
4
+ :major: 1
@@ -0,0 +1 @@
1
+ %w(ext show page episode).each { |x| require File.dirname(__FILE__) + "/imdb_tv/#{x}" }
@@ -0,0 +1,9 @@
1
+ module ImdbTV
2
+ class Episode
3
+ include FromHash
4
+ attr_accessor :season, :episode_num, :episode_title
5
+ def to_s
6
+ "Season #{season} Ep #{episode_num} - #{episode_title}"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ module FromHash
2
+ def from_hash(ops)
3
+ ops.each do |k,v|
4
+ send("#{k}=",v)
5
+ end
6
+ end
7
+ def initialize(ops={})
8
+ from_hash(ops)
9
+ end
10
+ end
11
+
12
+ class Class
13
+ def store_method(a,b,&blk)
14
+ fattr(a,&blk)
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module ImdbTV
2
+ class Page
3
+ include FromHash
4
+ attr_accessor :show_id
5
+ def episodes_url
6
+ "http://www.imdb.com/title/#{show_id}/episodes"
7
+ end
8
+ fattr(:doc) do
9
+ Hpricot(open(episodes_url))
10
+ end
11
+ fattr(:seasons) do
12
+ doc.search("//div.season-filter-all")
13
+ end
14
+ fattr(:season_text) { seasons.map { |x| x.innerText }.join("") }
15
+ store_method(:episodes,:show_id) do
16
+ season_text.scan(/Season (\d+), Episode (\d+): (.*?)Original Air/).map do |arr|
17
+ Episode.new(:season => arr[0].to_i, :episode_num => arr[1].to_i, :episode_title => arr[2].strip)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,39 @@
1
+ require 'rubygems'
2
+ require 'open-uri'
3
+ require 'hpricot'
4
+ require 'fattr'
5
+ require 'singleton'
6
+ #require File.dirname(__FILE__) + "/store"
7
+
8
+ module ImdbTV
9
+ class Shows
10
+ include Singleton
11
+ fattr(:hash) do
12
+ Hash.new { |h,k| h[k] = Show.new(:title => k) }
13
+ end
14
+ def get(show)
15
+ hash[show]
16
+ end
17
+ end
18
+
19
+ class Show
20
+ include FromHash
21
+ attr_accessor :title
22
+ fattr(:google_url) do
23
+ "http://www.google.com/search?q=#{title}+imdb&btnI=3564".gsub(/ /,'+')
24
+ end
25
+ fattr(:show_id) do
26
+ str = open(google_url) { |f| f.read }
27
+ raise "can't find show id for #{title}" unless str =~ /id=(tt\d+);/
28
+ $1
29
+ end
30
+ fattr(:page) { Page.new(:show_id => show_id) }
31
+ fattr(:episodes) do
32
+ page.episodes
33
+ end
34
+ def get_title(a_ep)
35
+ foundEp = episodes.find { |x| x.season == a_ep.season and x.episode_num == a_ep.episode_num }
36
+ foundEp ? foundEp.episode_title : "Unknown"
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,2 @@
1
+ files = Dir[File.dirname(__FILE__)+"/spec_*.rb"].reject { |x| x =~ /spec_helper/ }
2
+ files.each { |x| require x }
@@ -0,0 +1,421 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3
+
4
+ <html>
5
+ <head>
6
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
7
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
8
+ <title>&#34;Mad Men&#34; (2007) - Episode list</title>
9
+ <meta name="title" content="&#34;Mad Men&#34; (2007) - Episode list">
10
+ <meta name="description" content="Mad Men on IMDb: Movies, TV, Celebs, and more...">
11
+
12
+ <meta name="keywords" content="Reviews, Showtimes, DVDs, Photos, Message Boards, User Ratings, Synopsis, Trailers, Credits">
13
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SF6944af6e2e2676eb0445c8c49a414ca0/css2/consumersite.css" />
14
+ <script type="text/javascript" src="http://i.media-imdb.com/images/SFbfba6a953dd6d50417ad62c5434b6211/a/js/ads.js"></script>
15
+ <link rel="icon" href="http://i.imdb.com/favicon.ico" />
16
+ <link rel="apple-touch-icon" href="http://i.media-imdb.com/apple-touch-icon.png" />
17
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SF4c7fac7df891e8a2e3e2fa56d43f839e/css2/app/video/episodes.css"><link rel="stylesheet" type="text/css" href="http://i.media-imdb.com/images/SF9cafc9501d815ffdcef81a364ea168dd/tn15/tn15.css" />
18
+
19
+
20
+
21
+
22
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SF2c798c76034e2cd9e0b278a275ee3096/wheel/base.css" />
23
+
24
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SF004f13919020e5c71af8b193c775b46e/wheel/widgets.css" />
25
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SFeb3e1c79d13e44683db2d9c3c3cf53e3/wheel/layout.css" />
26
+
27
+ <!--[if IE]>
28
+ <link rel="stylesheet" type="text/css" media="screen" href="http://i.media-imdb.com/images/SF89a770dc6c9399c865b1dcde50919f2d/wheel/ie.css" />
29
+ <![endif]-->
30
+ <link rel="stylesheet" type="text/css" href="http://i.media-imdb.com/images/SFf4998318a26e5a6e8304e5bbbef6581a/wheel/fixed.css" />
31
+
32
+ </head>
33
+ <!-- h=iop632 i=2009-02-17 s=legacy(default) t='Wed Feb 18 08:39:46 2009' -->
34
+
35
+ <body bgcolor="#ffffff" text="#000000" id="styleguide-v2" class="fixed">
36
+ <div id="wrapper">
37
+
38
+
39
+
40
+ <script language="JavaScript" type="text/javascript">ord = ((this.ad_utils) && (this.ad_utils.ord)) ? this.ad_utils.ord : Math.random()*10000000000000000; </script><!-- begin FLOATING1 -->
41
+ <div id="floating1_wrapper">
42
+ <script type="text/javascript"> ad_utils.ad_queue.push({tile:'1',slot:'floating1'});
43
+ </script>
44
+ <iframe src="/images/a/ifb/doubleclick/expand.html#imdb2.consumer.title/;tile=1;sz=1x1,4x1;p=f1;ifb=pf;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=[CLIENT_SIDE_ORD]?" id="floating1" name="floating1" class="yesScript" width="0" height="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" onload="ad_utils.resize_iframe(this)"></iframe>
45
+
46
+ <noscript><a href="http://ad.doubleclick.net/jump/imdb2.consumer.title/;tile=1;sz=1x1,4x1;p=f1;ifb=pf;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" target="_blank"><img src="http://ad.doubleclick.net/ad/imdb2.consumer.title/;tile=1;sz=1x1,4x1;p=f1;ifb=pf;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" border="0" alt="advertisement" /></a></noscript>
47
+
48
+ </div>
49
+ <!-- End FLOATING1 -->
50
+
51
+
52
+
53
+
54
+
55
+ <div id="root">
56
+ <layer name="root">
57
+
58
+
59
+ <div id="nb15">
60
+ <div id="nb15supertab">
61
+
62
+
63
+ <!-- begin TOP_AD -->
64
+ <div id="top_ad_wrapper">
65
+ <script type="text/javascript"> ad_utils.ad_queue.push({tile:'2',slot:'top_ad'});
66
+ </script>
67
+ <iframe src="/images/a/ifb/doubleclick/expand.html#imdb2.consumer.title/;tile=2;sz=468x60,728x90,1008x150,9x1;p=t;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=[CLIENT_SIDE_ORD]?" id="top_ad" name="top_ad" class="yesScript" width="0" height="80" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" onload="ad_utils.resize_iframe(this)"></iframe>
68
+
69
+ <noscript><a href="http://ad.doubleclick.net/jump/imdb2.consumer.title/;tile=2;sz=468x60,728x90,1008x150,9x1;p=t;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" target="_blank"><img src="http://ad.doubleclick.net/ad/imdb2.consumer.title/;tile=2;sz=468x60,728x90,1008x150,9x1;p=t;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" border="0" alt="advertisement" /></a></noscript>
70
+
71
+ </div>
72
+ <!-- End TOP_AD -->
73
+
74
+ </div>
75
+ <div id="nb15home">
76
+ <a href="/" onClick="(new Image()).src='/rg/nav-home/navbar/images/b.gif?link=/';"><img src="http://i.media-imdb.com/images/nb15/logo2.gif" alt="Home"
77
+ title="The Internet Movie Database" border="0" width="177" height="78"></a>
78
+ </div>
79
+ <div id="nb15botbg">
80
+
81
+ <div id="nb15tabs">
82
+ <a id="nb15nowplaying" href="/nowplaying/" onClick="(new Image()).src='/rg/nav-nowplaying/navbar/images/b.gif?link=/nowplaying/';"><i>Now Playing</i></a>
83
+ <a id="nb15news" href="/news/" onClick="(new Image()).src='/rg/nav-news/navbar/images/b.gif?link=/news/';"><i>Movie/TV News</i></a>
84
+ <a id="nb15mm" href="/mymovies/list" onClick="(new Image()).src='/rg/nav-mymovies/navbar/images/b.gif?link=/mymovies/list';"><i>My Movies</i></a>
85
+ <a id="nb15dvd" href="/sections/dvd/" onClick="(new Image()).src='/rg/nav-video/navbar/images/b.gif?link=/sections/dvd/';"><i>DVD New Releases</i></a>
86
+ <a id="nb15imdbtv" href="/sections/tv/" onClick="(new Image()).src='/rg/nav-imdbtv/navbar/images/b.gif?link=/sections/tv/';"><i>IMDbTV</i></a>
87
+ <a id="nb15boards" href="/boards/" onClick="(new Image()).src='/rg/nav-boards/navbar/images/b.gif?link=/boards/';"><i>Message Boards</i></a>
88
+ <a id="nb15showtimes" href="/showtimes/" onClick="(new Image()).src='/rg/nav-showtimes/navbar/images/b.gif?link=/showtimes/';"><i>Showtimes &amp; Tickets</i></a>
89
+ <a id="nb15pro" href="http://pro.imdb.com/r/imdb-nav/" onClick="(new Image()).src='/rg/nav-pro/navbar/images/b.gif?link=http://pro.imdb.com/r/imdb-nav/';"><i>IMDbPro</i></a>
90
+ <a id="nb15resume" href="http://resume.imdb.com/" onClick="(new Image()).src='/rg/nav-resume/navbar/images/b.gif?link=http://resume.imdb.com/';"><i>IMDb Resume</i></a>
91
+ </div>
92
+
93
+ <div id="nb15topbg">
94
+ <div id="nb15iesux">
95
+ <div id="nb15personal">
96
+
97
+ &nbsp;<span><a href="/register/login" onClick="(new Image()).src='/rg/sub-login/navbar/images/b.gif?link=/register/login';">Login</a> |
98
+ <a href="/register/?why=personalize" onClick="(new Image()).src='/rg/sub-register/navbar/images/b.gif?link=/register/?why=personalize';">Register</a></span>
99
+
100
+ </div>
101
+ </div>
102
+ </div>
103
+ <div id="nb15sub">
104
+ <div>
105
+ <a href="/" onClick="(new Image()).src='/rg/sub-home/navbar/images/b.gif?link=/';">Home</a> |
106
+
107
+ <a href="/chart/" onClick="(new Image()).src='/rg/sub-top/navbar/images/b.gif?link=/chart/';">Top&nbsp;Movies</a> |
108
+ <a href="/sections/gallery/" onClick="(new Image()).src='/rg/sub-gallery/navbar/images/b.gif?link=/sections/gallery/';">Photos</a> |
109
+ <a href="/indie/" onClick="(new Image()).src='/rg/sub-indie/navbar/images/b.gif?link=/indie/';">Independent&nbsp;Film</a> |
110
+ <a href="/sections/games/" onClick="(new Image()).src='/rg/sub-gamebase/navbar/images/b.gif?link=/sections/games/';">GameBase</a> |
111
+ <a href="/Browse/" onClick="(new Image()).src='/rg/sub-browse/navbar/images/b.gif?link=/Browse/';">Browse</a> |
112
+
113
+ <a href="/help/" onClick="(new Image()).src='/rg/sub-help/navbar/images/b.gif?link=/help/';">Help</a>
114
+ </div>
115
+ </div>
116
+ <div id="nb15search">
117
+ <span class=search><a href="/search" onClick="(new Image()).src='/rg/search-img/navbar/images/b.gif?link=/search';">search</a></span>
118
+ <form method="get" action="/find" name="find">
119
+ <select name="s">
120
+ <option value="all" selected>All</option>
121
+ <option value="tt">Titles</option>
122
+ <option value="ep">TV Episodes</option>
123
+
124
+ <option>My Movies</option>
125
+
126
+ <option value="nm">Names</option>
127
+ <option value="co">Companies</option>
128
+
129
+ <option value="kw">Keywords</option>
130
+
131
+
132
+ <option value="char">Characters</option>
133
+
134
+ <option>Quotes</option>
135
+ <option>Bios</option>
136
+ <option>Plots</option>
137
+
138
+ </select>
139
+ <input name="q" size="28" value="">
140
+
141
+ <input type="image" id="nb15go_image" src="http://i.media-imdb.com/images/SF3892fa575b88eeb705320cfdeddd1539/intl/en/go.gif" alt="go" value="go" title="go">
142
+
143
+
144
+ <span id="nb15searchlinks">
145
+
146
+ <a href="/search" onClick="(new Image()).src='/rg/search-more/navbar/images/b.gif?link=/search';">more</a> |
147
+ <a href="/help/show_leaf?searchtips" onClick="(new Image()).src='/rg/search-tips/navbar/images/b.gif?link=/help/show_leaf?searchtips';">tips</a>
148
+
149
+ </span>
150
+ </form>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+
156
+
157
+ <!-- begin NAVSTRIP -->
158
+ <div id="navstrip_wrapper">
159
+ <script type="text/javascript"> ad_utils.ad_queue.push({tile:'3',slot:'navstrip'});
160
+ </script>
161
+ <iframe src="/images/a/ifb/doubleclick/expand.html#imdb2.consumer.title/;tile=3;sz=1008x40,7x1;p=ns;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=[CLIENT_SIDE_ORD]?" id="navstrip" name="navstrip" class="yesScript" width="0" height="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" onload="ad_utils.resize_iframe(this)"></iframe>
162
+
163
+ <noscript><a href="http://ad.doubleclick.net/jump/imdb2.consumer.title/;tile=3;sz=1008x40,7x1;p=ns;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" target="_blank"><img src="http://ad.doubleclick.net/ad/imdb2.consumer.title/;tile=3;sz=1008x40,7x1;p=ns;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" border="0" alt="advertisement" /></a></noscript>
164
+
165
+ </div>
166
+ <!-- End NAVSTRIP -->
167
+
168
+
169
+ <div id="pagecontent">
170
+
171
+ <div id="tn15" class="episodes">
172
+ <div id="tn15crumbs">
173
+ <a href="/">IMDb</a> &gt;
174
+ <a href="/title/tt0804503/">&#34;Mad Men&#34; (2007)</a> &gt; <b>Episode list</b>
175
+ </div>
176
+ <div id="tn15lhs">
177
+
178
+ <div class="photo">
179
+ <a name="poster" href="/rg/action-box-title/primary-photo/media/rm3244005120/tt0804503" title="&#34;Mad Men&#34;"><img border="0" alt="&#34;Mad Men&#34;" title="&#34;Mad Men&#34;" src="http://ia.media-imdb.com/images/M/MV5BMjA2NDExMjM1M15BMl5BanBnXkFtZTcwMTk3ODc3MQ@@._V1._SX96_SY140_.jpg" /></a>
180
+ </div>
181
+
182
+ <div id="action-box" class="action-box">
183
+
184
+ <a class="linkasbutton-primary disabled">Watch It</a>
185
+
186
+ <p><a href="/rg/action-box-title/watch-at-amazon/r/50403000000050a0904747038303435303330000001036a08046f677e6c6f6164600000010d6a02055350000001037a0104700000010f5a09096d64626d21667f6460000001047">Watch it at Amazon</a></p>
187
+
188
+ <a class="linkasbutton-secondary" href="/rg/action-box-title/buy-at-amazon/r/50403000000040a0904747038303435303330000001036a03016c6c600000010d6a02055350000001037a0104700000010f5">Buy it at Amazon</a>
189
+
190
+ <hr />
191
+ <a class="linkasbutton-secondary" href="/rg/action-box-title/pro-link/http://pro.imdb.com/title/tt0804503/">More at IMDb Pro</a>
192
+
193
+ <a class="linkasbutton-secondary" href="/rg/action-box-title/boards-link/title/tt0804503/board">Discuss in Boards</a>
194
+
195
+ <a class="linkasbutton-secondary" href="/rg/action-box-title/add-to-my-movies/mymovies/list?pending&amp;add=0804503">Add to My Movies</a>
196
+ <a class="linkasbutton-secondary" href="/rg/action-box-title/update-data/updates?auto=legacy/title/tt0804503/">Update Data</a>
197
+ </div>
198
+
199
+ <h6 style="margin-top: 4px">Quicklinks</h6><form><select id="quicklinks_select" onchange="document.location = this.options[this.selectedIndex].value">
200
+ <option value="maindetails">main details</option><option value="combined">combined details</option><option value="fullcredits">full cast and crew</option><option value="companycredits">company credits</option><option value="episodes" selected>episode list</option><option value="epcast">episodes cast</option><option value="epdate">episode ratings</option><option value="eprate">... by rating</option><option value="epvote">... by votes</option><option value="tvschedule">tv schedule</option><option value="usercomments">user comments</option><option value="externalreviews">external reviews</option><option value="awards">awards</option><option value="ratings">user ratings</option><option value="recommendations">recommendations</option><option value="board">message board</option><option value="keywords">plot keywords</option><option value="trivia">trivia</option><option value="movieconnections">movie connections</option><option value="faq">FAQ</option><option value="sales">merchandising links</option><option value="releaseinfo">release dates</option><option value="locations">filming locations</option><option value="technical">technical specs</option><option value="dvd">DVD details</option><option value="literature">literature listings</option><option value="news">NewsDesk</option><option value="taglines">taglines</option><option value="trailers">trailers and videos</option><option value="posters">posters</option><option value="photogallery">photo gallery</option><option value="officialsites">official sites</option><option value="miscsites">miscellaneous</option><option value="photosites">photographs</option><option value="soundsites">sound clips</option><option value="videosites">video clips</option>
201
+ </select></form>
202
+ <h6>Top Links</h6>
203
+ <a onClick="(new Image()).src='/rg/title-top-links/trailers/images/b.gif?link=/title/tt0804503/trailers';" href="/title/tt0804503/trailers" class="link">trailers and videos</a><a onClick="(new Image()).src='/rg/title-top-links/fullcredits/images/b.gif?link=/title/tt0804503/fullcredits';" href="/title/tt0804503/fullcredits" class="link">full cast and crew</a><a onClick="(new Image()).src='/rg/title-top-links/trivia/images/b.gif?link=/title/tt0804503/trivia';" href="/title/tt0804503/trivia" class="link">trivia</a><a onClick="(new Image()).src='/rg/title-top-links/officialsites/images/b.gif?link=/title/tt0804503/officialsites';" href="/title/tt0804503/officialsites" class="link">official sites</a><a onClick="(new Image()).src='/rg/title-top-links/quotes/images/b.gif?link=/title/tt0804503/quotes';" href="/title/tt0804503/quotes" class="link empty">memorable quotes</a>
204
+ <h6>Overview</h6>
205
+ <a href="maindetails" class="link">main details</a><a href="combined" class="link">combined details</a><a href="fullcredits" class="link">full cast and crew</a><a href="companycredits" class="link">company credits</a><a href="episodes" class="link selected">episode list</a><a href="epcast" class="link">episodes cast</a><a href="epdate" class="link">episode ratings</a><a href="eprate" class="link">... by rating</a><a href="epvote" class="link">... by votes</a><a href="tvschedule" class="link">tv schedule</a>
206
+ <h6>Awards & Reviews</h6>
207
+ <a href="usercomments" class="link">user comments</a><a href="externalreviews" class="link">external reviews</a><a href="newsgroupreviews" class="link empty">newsgroup reviews</a><a href="awards" class="link">awards</a><a href="ratings" class="link">user ratings</a><a href="recommendations" class="link">recommendations</a><a href="board" class="link">message board</a>
208
+ <h6>Plot & Quotes</h6>
209
+ <a href="plotsummary" class="link empty">plot summary</a><a href="keywords" class="link">plot keywords</a><a href="amazon" class="link empty">Amazon.com summary</a><a href="quotes" class="link empty">memorable quotes</a>
210
+ <h6>Fun Stuff</h6>
211
+ <a href="trivia" class="link">trivia</a><a href="goofs" class="link empty">goofs</a><a href="soundtrack" class="link empty">soundtrack listing</a><a href="crazycredits" class="link empty">crazy credits</a><a href="alternateversions" class="link empty">alternate versions</a><a href="movieconnections" class="link">movie connections</a><a href="faq" class="link">FAQ</a>
212
+ <h6>Other Info</h6>
213
+
214
+ <a href="sales" class="link">merchandising links</a><a href="business" class="link empty">box office/business</a><a href="releaseinfo" class="link">release dates</a><a href="locations" class="link">filming locations</a><a href="technical" class="link">technical specs</a><a href="laserdisc" class="link empty">laserdisc details</a><a href="dvd" class="link">DVD details</a><a href="literature" class="link">literature listings</a><a href="news" class="link">NewsDesk</a>
215
+ <h6>Promotional</h6>
216
+ <a href="taglines" class="link">taglines</a>
217
+ <a href="trailers" class="link">trailers and videos</a>
218
+ <a href="posters" class="link">posters</a>
219
+ <a href="photogallery" class="link">photo gallery</a>
220
+
221
+
222
+ <h6>External Links</h6>
223
+ <a href="cinemashowtimes" class="link empty">showtimes</a><a href="officialsites" class="link">official sites</a><a href="miscsites" class="link">miscellaneous</a><a href="photosites" class="link">photographs</a><a href="soundsites" class="link">sound clips</a><a href="videosites" class="link">video clips</a>
224
+
225
+
226
+
227
+ </div>
228
+ <div id="tn15main">
229
+
230
+ <div id="tn15title">
231
+ <h1><small>Episode list for<br></small><a class="main" href="/title/tt0804503/">&#34;Mad Men&#34;</a> <span>(<a href="/Sections/Years/2007/">2007</a>) <span class="pro-link"><a href="http://pro.imdb.com/rg/episodes-title/tconst-pro-header-link/title/tt0804503/">More at <strong>IMDbPro</strong> &raquo;</a></span></span></h1>
232
+ </div>
233
+
234
+ <div id="tn15content">
235
+
236
+ <div id="tn15adrhs">
237
+
238
+
239
+
240
+ <!-- begin TOP_RHS -->
241
+ <div id="top_rhs_wrapper">
242
+ <script type="text/javascript"> ad_utils.ad_queue.push({tile:'4',slot:'top_rhs'});
243
+ </script>
244
+ <iframe src="/images/a/ifb/doubleclick/expand.html#imdb2.consumer.title/;tile=4;sz=300x250,300x600,160x600,171x600,11x1;p=tr;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=[CLIENT_SIDE_ORD]?" id="top_rhs" name="top_rhs" class="yesScript" width="0" height="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" onload="ad_utils.resize_iframe(this)"></iframe>
245
+
246
+ <noscript><a href="http://ad.doubleclick.net/jump/imdb2.consumer.title/;tile=4;sz=300x250,300x600,160x600,171x600,11x1;p=tr;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" target="_blank"><img src="http://ad.doubleclick.net/ad/imdb2.consumer.title/;tile=4;sz=300x250,300x600,160x600,171x600,11x1;p=tr;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" border="0" alt="advertisement" /></a></noscript>
247
+
248
+ </div>
249
+ <!-- End TOP_RHS -->
250
+
251
+ <div id="top_rhs_after" class="after_ad hidden">advertisement</div>
252
+
253
+
254
+
255
+ </div>
256
+
257
+
258
+ <h3>View by:</h3>
259
+ <p>
260
+ <b>Episodes:</b>
261
+ <span id="all-filter" class="episode-filter episode-filter-selected">
262
+ <a name=""></a>
263
+ All (<span class="episode-count">26</span>)</span>
264
+
265
+ <span id="feature-filter">&nbsp;|&nbsp;<span class="episode-filter">
266
+ <a name="has-feature"></a>
267
+ With full-length videos (<span id="feature-count"></span>) </span>
268
+ </span>
269
+ <span id="video-filter">&nbsp;|&nbsp;<span class="episode-filter">
270
+ <a name="has-video"></a>
271
+ With videos (<span id="video-count"></span>)
272
+ </span></span>&nbsp;|&nbsp;<a href="videogallery">See all videos <span id="all-videos-count">(7)</span> &raquo;</a></span>
273
+
274
+ </p>
275
+ <p>
276
+ <b>Season:</b>
277
+
278
+ <span class="episode-filter"><a name="filter-season-1">1</a></span>
279
+ &nbsp;|&nbsp;
280
+ <span class="episode-filter"><a name="filter-season-2">2</a></span>
281
+
282
+ <br>
283
+ <b>Year:</b>
284
+
285
+ <span class="episode-filter"><a name="filter-year-2007">2007</a></span>
286
+ &nbsp;|&nbsp;
287
+ <span class="episode-filter"><a name="filter-year-2008">2008</a></span>
288
+
289
+ <br><br>
290
+ </p>
291
+
292
+ <div class="season-filter-all filter-season-1">
293
+ <hr/>
294
+ <h3><a name="season-1">
295
+ Season 1
296
+ </a></h3>
297
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 1: <a href="/title/tt1059578/">Smoke Gets in Your Eyes</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>19 July 2007</strong></span><br> In 1960 New York City - the high-powered and glamorous "Golden Age" of advertising - Don Draper, the biggest ad man in the business, struggles to stay a step ahead of the rapidly changing times and the young executives nipping at his heels.</td></tr></table></div>
298
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 2: <a href="/title/tt1049715/">Ladies Room</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>26 July 2007</strong></span><br> Don Draper is reluctant to talk about his past, or his childhood, whether with his wife Betty or his boss Roger Sterling. Joan Holloway teaches Peggy Olsen how to wrangle a free lunch out of some of the ad men. Roger Sterling raises the issue of working for the upcoming Nixon presidential campaign and while Don doesn't have much enthusiasm, senior partner Bert Cooper insists that they will go ahead and orders Don to put a team together. The creative team has to come up with an ad campaign for a new deodorant in an aerosol spray can. Sally Draper's doctor recommends that she see a psychiatrist.</td></tr></table></div>
299
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 3: <a href="/title/tt1049716/">Marriage of Figaro</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>2 August 2007</strong></span><br> Pete Campbell returns from his honeymoon with tall tales and a big grin on his face. He does tell Peggy Olson that their fling before his marriage was for one night only. Don Draper runs into an old army buddy who knows him under the name of Dick Whitman. He also takes a tour of Rachel Menken's store but in a private moment, their mutual attraction becomes evident. The Drapers have friends over for their daughter's birthday party, including the divorc�e who lives down the street. Don however is obviously unhappy with his lot in life and seems to be carrying a burden that is not apparent.</td></tr></table></div>
300
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 4: <a href="/title/tt1040713/">New Amsterdam</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>9 August 2007</strong></span><br> Pete Campbell oversteps the mark when he pitches an idea for ad campaign to the head of Bethlehem Steel without telling Don Draper. Draper wants him fired but learns a lesson in corporate politics. Pete's wife wants to buy a Manhattan apartment but he has to approach his cold and distant parents for a loan. Pete's in-laws, however, are more forthcoming.</td></tr></table></div>
301
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 5: <a href="/title/tt1097127/">5G</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>16 August 2007</strong></span><br> Don Draper is shaken when his past life comes back to haunt him. After his picture appears in a local newspaper, Adam Whitman, a man who claims to be his younger brother, approaches him. Don, or Dick as his brother knows him, initially denies everything but in the end admits to having taken on a new name. He refuses however to have anything to do with him and tries to buy his silence. When one of the ad men gets a short story published, Pete Campbell is frustrated that his own stories have yet to see the light of day. When his wife approaches an old beau to see if he will publish the stories, he has an interesting proposition for her.</td></tr></table></div>
302
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 6: <a href="/title/tt1042049/">Babylon</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>23 August 2007</strong></span><br> The Agency is looking to land an advertising contract to promote tourism to Israel. Don and his team try to come with a theme but know so little about the country they're stumped so Don calls Rachel Menken to see if she has any ideas. Roger Sterling is getting tired of sneaking around with Joan Holloway and suggests she should her own apartment but she knows better. Peggy comes up with an advertising concept during a testing session for a new line of lipsticks and she's subsequently asks to write copy.</td></tr></table></div>
303
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 7: <a href="/title/tt1050979/">Red in the Face</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>30 August 2007</strong></span><br> When Don invites Roger home for dinner, too much alcohol fuels repercussions between Don and Betty and between Don and Roger. Joan puts Roger off for the weekend, spending time with her roommate Carol instead. Pete exchanges a wedding gift for a rifle, and then shares a hunting fantasy with Peggy. Bertram Cooper arranges for the Nixon campaign to meet with him, Roger, Don, and Pete.</td></tr></table></div>
304
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 8: <a href="/title/tt1097128/">The Hobo Code</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>6 September 2007</strong></span><br> Pete Campbell and Peggy Olsen start an office romance. Peggy's copy for the lipstick account goes over well and the men in the firm congratulate her. A new telephone receptionist, Lois Saddler, takes a liking to Salvatore Romano but his own interests seem to lie elsewhere. Don Draper gets an unexpected bonus from Bert Cooper and wants to take Midge on a surprise trip to Paris. She seems too involved with her beatnik friends however. Don reflects on his unhappy childhood and in flashbacks he reveals some life lessons he learned early on when a hobo spent the day working on the family farm in exchange for a meal.</td></tr></table></div>
305
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 9: <a href="/title/tt1097298/">Shoot</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>13 September 2007</strong></span><br> Don is courted by Jim Hobarth, head of a larger ad firm who offers him more money and more creative resources to join them. Betty Draper rekindles her interest in modeling after Hobarth suggests she should try it. She doesn't realize it's all part of the strategy to get Don on board. Peggy Olsen is fretting over her weight gain but doesn't appreciate Joan's advice about getting ahead in the office. The ad team tries to counter the advertising coming out of the Kennedy campaign. Pete Campbell comes up with an idea to keep Kennedy's image off TV in key States.</td></tr></table></div>
306
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 10: <a href="/title/tt1094472/">Long Weekend</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>27 September 2007</strong></span><br> It's Labor Day weekend and most of the men are sending their wives away for a few days. Don Draper's wife Betty is dreading the thought, as her father and his new girlfriend, whom she detests, will be staying with them. With the election approaching, the team at Sterling Cooper is gloomy since the Nixon campaign has not been following their advice. Roger Sterling was hoping to spend Friday night with Joan Holloway but having just seen the movie <a href="/title/tt0053604/">The Apartment</a> (1960), she is feeling a bit used. She plans a night on the town with her old college friend who has some surprising information for her. Don and Roger invite twin sisters from a casting call to join them for a drink but things go badly for Roger who suffers a serious heart attack. After the incident Don ends up spending the night with Rachel Menken where reveals a lot of his inner self.</td></tr></table></div>
307
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 11: <a href="/title/tt1108366/">Indian Summer</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>4 October 2007</strong></span><br> Peggy is given the opportunity to write copy for a new weight loss device that everyone knows is useless. She finds an interesting use for it, however. Afraid of losing the Lucky Strike cigarette account, Bert Cooper gets Roger Sterling to come in for a one-hour meeting but he has another attack. Don Draper becomes a partner and takes over from his friend Roger, but some of the ad men are sharpening their resumes nonetheless. Pete Campbell wants a promotion but Draper doesn't seem too interested. Pete keeps a parcel addressed to Don that contains some very interested information.</td></tr></table></div>
308
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 12: <a href="/title/tt1102103/">Nixon vs. Kennedy</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>11 October 2007</strong></span><br> Election night arrives and the staff of Sterling Cooper has a party while watching the returns. The election is close and it's obviously going to be a long night. Now a senior partner in the firm, Don Draper must hire a new head of account services, a post that Pete Campbell yearns for. Aware of Draper's secret past, he tries to strong-arm him into giving him the job. With his secret out, Don panics and he asks Rachel Menken to run away with him. Regaining his composure, Don calls Pete's bluff leading to a confrontation with Bert Cooper.</td></tr></table></div>
309
+ <div class="filter-all filter-year-2007"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 1, Episode 13: <a href="/title/tt1105057/">The Wheel</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>18 October 2007</strong></span><br> Don and Betty Draper have an argument when it becomes apparent that he doesn't want to spend Thanksgiving with her family and she plans on going only with the children. He also learns some information about his brother Adam. Pete Campbell confirms that he has landed an account from his father-in-law for a new skin care product called Clearasil. He objects however when Don gives the account to Peggy Olson, who he has just been promoted to junior copywriter. Peggy proves her mettle in auditions for the weight loss device but later is feeling unwell and goes to the hospital where she is given some shocking news. Don comes up with a brilliant presentation for Kodak on a new wheel-like storage device for a slide projector that he dubs a carousel.</td></tr></table></div>
310
+
311
+ </div>
312
+
313
+ <div class="season-filter-all filter-season-2">
314
+ <hr/>
315
+ <h3><a name="season-2">
316
+ Season 2
317
+ </a></h3>
318
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 1: <a href="/title/tt1118051/">For Those Who Think Young</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>27 July 2008</strong></span><br> On Valentine's Day, the staff of the Sterling Cooper Advertising Agency is hustling and checking out the newest office equipment. Don and Duck clash over an account, and Betty hears from an old friend.</td></tr></table></div>
319
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 2: <a href="/title/tt1118056/">Flight 1</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>3 August 2008</strong></span><br> A plane crash causes the firm to go after the account for the airline involved and drop the smaller airline they have an account with. Peggy pays a visit to her mother and sister, who are now guardians of her child.</td></tr></table></div>
320
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 3: <a href="/title/tt1118057/">The Benefactor</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>10 August 2008</strong></span><br> Harry tries to gather support around a controversial sponsorship in order to bolster his career. When Don ditches work for a day, trouble brews on the set of a commercial. Later, Betty joins her husband when he attempts to placate his clients with an amicable dinner.</td></tr></table></div>
321
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 4: <a href="/title/tt1118058/">Three Sundays</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>17 August 2008</strong></span><br> A last minute pitch meeting has Sterling Cooper staffers working double time in preparation. Peggy's family hosts lunch for their church's new priest, and Don and Betty have a family weekend together. Also, Roger Sterling is smitten with a "date" that Pete and Ken provide to a client for a business lunch.</td></tr></table></div>
322
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 5: <a href="/title/tt1118059/">The New Girl</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>24 August 2008</strong></span><br> Joan finds Don the perfect secretary, and Don finds himself in the middle of issues between TV comedian Jimmy and his wife, Bobbie.</td></tr></table></div>
323
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 6: <a href="/title/tt1118060/">Maidenform</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>31 August 2008</strong></span><br> Don and Duck try to bury the hatchet, and Peggy attempts to join in on the execs' after-hours meetings. Also, Duck receives a family visit at the office.</td></tr></table></div>
324
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 7: <a href="/title/tt1118061/">The Gold Violin</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>7 September 2008</strong></span><br> To show that he has "arrived," Don buys a new car. Pete, Harry and Ken come up with a plan to attract new business, and Don's secretary makes a serious error, which could mean trouble for Joan. Cooper gets a new piece of office art that attracts the interest of the Sterling Cooper staff.</td></tr></table></div>
325
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 8: <a href="/title/tt1118062/">A Night to Remember</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>14 September 2008</strong></span><br> Betty becomes suspicious that Don is having an affair after her conversation with Jimmy Barrett, Joan helps out in the television department, and Peggy helps the church with a dance flyer.</td></tr></table></div>
326
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 9: <a href="/title/tt1118063/">Six Month Leave</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>28 September 2008</strong></span><br> Don checks in to a hotel after his separation from Betty. Back at the office, he is forced to get rid of Freddy against his will because of his drinking problem.</td></tr></table></div>
327
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 10: <a href="/title/tt1118052/">The Inheritance</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>5 October 2008</strong></span><br> Don and Betty try to keep up appearances as they go to Betty's parents after her dad has a stroke. Peter has a long-dreaded meeting with his mother before he and Kinsey leave for a convention in Los Angeles.</td></tr></table></div>
328
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 11: <a href="/title/tt1118053/">The Jet Set</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>12 October 2008</strong></span><br> Don blows off the convention in Los Angeles when he meets a beautiful, exotic woman. Back at Sterling Cooper, a member of the creative staff comes out of the closet, and Duck falls off the wagon and initiates his power play.</td></tr></table></div>
329
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 12: <a href="/title/tt1118054/">The Mountain King</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>19 October 2008</strong></span><br> Don drops the Sterling Cooper radar and visits the wife of the man whose identity he stole. Back at the office, Bert and Roger consider the merger offer, Peggy makes a play for a real office, and Peter loses his father-in-law's account.</td></tr></table></div>
330
+ <div class="filter-all filter-year-2008"><hr /><table cellspacing="0" cellpadding="0"><tr> <td valign="top"><div class="episode_slate_container"><div class="episode_slate_missing"></div></div></td> <td valign="top"><h3>Season 2, Episode 13: <a href="/title/tt1118055/">Meditations in an Emergency</a></h3><span class="less-emphasis">Original Air Date&mdash;<strong>26 October 2008</strong></span><br> Under the backdrop of the Cuban Missile Crisis, Don returns to New York just as Betty finds out that she is pregnant. Meanwhile, everybody at Sterling Cooper contemplates their futures as news of the merger slowly leaks out.</td></tr></table></div>
331
+
332
+ </div>
333
+ <hr/><h3>Related Links</h3><table>
334
+ <tr><td width="33%" style="width: 400px"> <a href="/title/tt0804503/epcast" onClick="(new Image()).src='/rg/title-related/episodes-epcast/images/b.gif?link=/title/tt0804503/epcast';">Episode cast</a></td><td width="33%" style="width: 400px"> <a href="/title/tt0804503/eprate" onClick="(new Image()).src='/rg/title-related/episodes-eprate/images/b.gif?link=/title/tt0804503/eprate';">Episode ratings</a></td><td width="33%" style="width: 400px"> <a href="/title/tt0804503/epdate" onClick="(new Image()).src='/rg/title-related/episodes-epdate/images/b.gif?link=/title/tt0804503/epdate';">Episode ratings by date</a></td></tr><tr><td width="33%" style="width: 400px"> <a href="/title/tt0804503/epvote" onClick="(new Image()).src='/rg/title-related/episodes-epvote/images/b.gif?link=/title/tt0804503/epvote';">Episode ratings by votes</a></td><td width="33%" style="width: 400px"> <a href="/title/tt0804503/fullcredits" onClick="(new Image()).src='/rg/title-related/episodes-fullcredits/images/b.gif?link=/title/tt0804503/fullcredits';">Series credits</a></td><td width="33%" style="width: 400px"> <a href="/title/tt0804503/tvschedule" onClick="(new Image()).src='/rg/title-related/episodes-tvschedule/images/b.gif?link=/title/tt0804503/tvschedule';">TV schedule</a></td></tr><tr><td width="33%" style="width: 400px"> <a href="/title/tt0804503/maindetails" onClick="(new Image()).src='/rg/title-related/episodes-maindetails/images/b.gif?link=/title/tt0804503/maindetails';">Main details</a></td>
335
+ </table>
336
+ <div id="tn15bot">
337
+ <div class="right">
338
+
339
+
340
+
341
+
342
+ </div>
343
+ <div class="left">
344
+ <br/>
345
+ <div><a href="/updates?update=episode&parent=tt0804503"><img width="82" height="19" src="http://ia.media-imdb.com/media/imdb/01/I/32/05/13/10.gif" border="0" alt="Add a new episode" title="Add a new episode"></a><p><i>You may add a new episode for this TV series by clicking the 'add episode' button
346
+ </i></p></div>
347
+ </div>
348
+ </div>
349
+ <script type="text/javascript" src="http://i.media-imdb.com/images/SF221692cb3ce3ac8f23db85819234bf0f/js/jquery/1.2.6.js"></script>
350
+ <script type="text/javascript" src="http://i.media-imdb.com/images/SFb9458beb28226e0ce7716fd69ac68432/js/app/video/episodes.js"></script>
351
+
352
+ </div>
353
+ </div>
354
+ </div>
355
+ <br style="clear:left;" />
356
+ </div>
357
+
358
+ <div id="footer" class="ft">
359
+ <hr width="100%" size=1>
360
+ <p class="footer" align="center">
361
+ <a href="/">Home</a>&nbsp;
362
+ | <a href="/search">Search</A>&nbsp;
363
+ | <a href="/NowPlaying/">Now Playing</a>&nbsp;
364
+ | <a href="/News/">News</A>&nbsp;
365
+ | <a href="/register/?why=mymovies_footer">My Movies</A>&nbsp;
366
+ | <a href="/Games/">Games</A>&nbsp;
367
+ | <a href="/boards/">Boards</A>&nbsp;
368
+ | <a href="/help/">Help</a>&nbsp;
369
+ | <A HREF="/Showtimes">US&nbsp;Movie&nbsp;Showtimes</A>&nbsp;
370
+ | <A HREF="/top_250_films">Top 250</A>&nbsp;
371
+ | <a href="/register/?why=footer">Register</a>&nbsp;
372
+ | <A HREF="/recommends/">Recommendations</A>&nbsp;
373
+ | <A HREF="/widgets/">Widgets</A><br>
374
+ <A HREF="/Charts/">Box&nbsp;Office</A>
375
+ | <A HREF="/a2z">Index</A>
376
+ | <A HREF="/Sections/Trailers/">Trailers</A>
377
+
378
+ | <a href="/jobs"><b>Jobs</b></a>&nbsp;
379
+ | <a href="https://secure.imdb.com/register/subscribe?c=a394d4442664f6f6475627" onClick="(new Image()).src='/rg/PRO_FOOT/FOOTER/images/b.gif?link=https://secure.imdb.com/register/subscribe?c=a394d4442664f6f6475627';">
380
+ <span style="color:#cc3333"><b>IMDbPro.com&nbsp;-&nbsp;Free&nbsp;Trial</b></span></a>
381
+ | <a href="http://resume.imdb.com" onClick="(new Image()).src='/rg/resume-footer/footer/images/b.gif?link=http://resume.imdb.com';"><span style="color:#cc3333"><b>IMDb Resume</b></span></a>
382
+ <br><br>
383
+ <a href="/help/show_article?conditions">Copyright &copy;</a> 1990-2009
384
+ <a href="/help/">IMDb.com, Inc.</a><br>
385
+ <a href="/help/show_article?conditions">Terms</a> and <a href="/privacy">Privacy Policy</a> under which this service is provided to you.<br>
386
+ An <a href="http://www.amazon.com/exec/obidos/redirect-home/internetmoviedat"><img align="middle" width="86" height="18" border="0" src="http://i.media-imdb.com/images/icons/amazon_logo.gif" alt="Amazon.com"></a> company.&nbsp;
387
+ <a href="/advertising/">Advertise</a> on IMDb.&nbsp;
388
+ <a href="/tiger_redirect?FT_LIC&/licensing/">License</a> our content.
389
+ </p>
390
+ </div>
391
+
392
+ </layer>
393
+ </div>
394
+
395
+
396
+
397
+ <!-- begin BOTTOM_AD -->
398
+ <div id="bottom_ad_wrapper">
399
+ <script type="text/javascript"> ad_utils.ad_queue.push({tile:'5',slot:'bottom_ad'});
400
+ </script>
401
+ <iframe src="/images/a/ifb/doubleclick/expand.html#imdb2.consumer.title/;tile=5;sz=728x90,2x1;p=b;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=[CLIENT_SIDE_ORD]?" id="bottom_ad" name="bottom_ad" class="yesScript" width="0" height="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" onload="ad_utils.resize_iframe(this)"></iframe>
402
+
403
+ <noscript><a href="http://ad.doubleclick.net/jump/imdb2.consumer.title/;tile=5;sz=728x90,2x1;p=b;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" target="_blank"><img src="http://ad.doubleclick.net/ad/imdb2.consumer.title/;tile=5;sz=728x90,2x1;p=b;g=dr;tt=tv;id=tt0804503;coo=usa;k=c;ord=679971746141?" border="0" alt="advertisement" /></a></noscript>
404
+
405
+ </div>
406
+ <!-- End BOTTOM_AD -->
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+ <img src="/rd/?q=50403000000030a090f29616f226e276966600000010c6a08023030393032313830000001037a040379646370000001047&cb=123497518614454" width="1" height="1" alt="" border="0">
418
+ </div> <!-- id="wrapper" -->
419
+
420
+ </body>
421
+ </html>
@@ -0,0 +1,9 @@
1
+ require 'spec'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+
5
+ require 'imdb_tv'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,14 @@
1
+ require File.dirname(__FILE__) + "/spec_helper"
2
+
3
+ describe ImdbTV::Page do
4
+ before(:all) do
5
+ @page = ImdbTV::Page.new
6
+ @page.stub!(:episodes_url => File.dirname(__FILE__) + "/pages/madmen.html")
7
+ end
8
+ it 'episode count' do
9
+ @page.episodes.size.should == 26
10
+ end
11
+ it 'first episode title' do
12
+ @page.episodes.first.episode_title.should == 'Smoke Gets in Your Eyes'
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ require File.dirname(__FILE__) + "/spec_helper"
2
+
3
+ describe ImdbTV::Show do
4
+ before(:all) do
5
+ @show = ImdbTV::Shows.instance.get('Mad Men')
6
+ @page = @show.page
7
+ @show.stub!(:show_id => "not needed")
8
+ @page.stub!(:episodes_url => File.dirname(__FILE__) + "/pages/madmen.html")
9
+ end
10
+ it 'episode count' do
11
+ @show.episodes.size.should == 26
12
+ end
13
+ it 'get_title' do
14
+ ep = ImdbTV::Episode.new(:episode_num => 1, :season => 1)
15
+ @show.get_title(ep).should == 'Smoke Gets in Your Eyes'
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: GFunk911-imdb-tv
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Mike Harris
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-19 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Library to get tv episode info
17
+ email: GFunk913@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - VERSION.yml
26
+ - lib/imdb_tv
27
+ - lib/imdb_tv/episode.rb
28
+ - lib/imdb_tv/ext.rb
29
+ - lib/imdb_tv/page.rb
30
+ - lib/imdb_tv/show.rb
31
+ - lib/imdb_tv.rb
32
+ - spec/imdb_tv_spec.rb
33
+ - spec/pages
34
+ - spec/pages/madmen.html
35
+ - spec/spec_helper.rb
36
+ - spec/spec_page.rb
37
+ - spec/spec_show.rb
38
+ has_rdoc: true
39
+ homepage: http://github.com/GFunk911/imdb-tv
40
+ post_install_message:
41
+ rdoc_options:
42
+ - --inline-source
43
+ - --charset=UTF-8
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ requirements: []
59
+
60
+ rubyforge_project:
61
+ rubygems_version: 1.2.0
62
+ signing_key:
63
+ specification_version: 2
64
+ summary: Library to get tv episode info
65
+ test_files: []
66
+