imdb_title 0.0.13 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98a6a77462d729feef55253f83e2d355de941b096042a0276f57c6fb3605e300
4
- data.tar.gz: ad714d913a00262ddabcf2595a03b194c607990335452b0dc7b1ebc85bc151c6
3
+ metadata.gz: 1f2c5057bf1d6d56223c7f768fcaa79f47c32331fce90f649f908cf4fef55cfd
4
+ data.tar.gz: ed469eb78e72a1ef66ecaf5e0a7ce361318fdc8af74180380924c7c6f57fa37f
5
5
  SHA512:
6
- metadata.gz: 8314eaea1f898c07bc7d7677e846680918a9b24dd794d02e68f1d88c86ea6d4c0bd47f9f0a9cd082b19c61af5e7550dfa4cd14cb4555be79a4c1195f260aa2bb
7
- data.tar.gz: 7fdce4f6b931bbaaf985f12d82a3e2cedea52c2be17929fb79d2235a86a94375866130f2cf43eb89c37eb41166d7f99042eed46887fa64406831a448ba39e297
6
+ metadata.gz: 954fbe4623ccb5895bcaed968c8ca5c41dc9411b0a85b4bf4b4f20002f081827166598ae2337a6627551d41ff701dc52f5b77b4d49b81496819348eca1128740
7
+ data.tar.gz: 6376626339749d8fb376fd0bbb691f448b3a7e2d6ff1f97335eeb596376b3185b7cbe4a2fc78689fc022f74a9202e0f4c46225c05014c809a3824529620f987c
data/lib/helper.rb CHANGED
@@ -5,5 +5,4 @@ require "nokogiri"
5
5
  require "httparty"
6
6
 
7
7
  # load all files & folders of the current directory 'lib'
8
- lib = __dir__
9
- Dir.glob(File.join(lib, "**", "*.rb")).sort.each(&method(:require))
8
+ Dir.glob(File.join(__dir__, "**", "*.rb")).each(&method(:require))
data/lib/imdb_title.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # load all dependencies
4
4
  require_relative "helper"
5
5
 
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### 1. Cast
8
8
  ### 2. Director
9
9
  ### 3. Genres
@@ -12,7 +12,7 @@ require_relative "helper"
12
12
  ### 6. Ratings
13
13
  ### 7. Title
14
14
  ### 8. Tagline
15
- ### 9. Prodcution Companies
15
+ ### 9. Production Companies
16
16
  ### 10. Release Date
17
17
 
18
18
  module IMDb
@@ -31,23 +31,18 @@ module IMDb
31
31
 
32
32
  # lists all top cast (Array)
33
33
  def casts
34
- html = document.css("a[data-testid=title-cast-item__actor]")
35
- return if html.empty?
36
-
37
- html.map(&:text)
34
+ document.css("a[data-testid=title-cast-item__actor]").map(&:text) || []
38
35
  end
39
36
 
40
37
  # list of directors (Array)
41
38
  def directors
42
- html = document.css("li[data-testid=title-pc-principal-credit]").first
43
- return unless html.text.match?(/Director|Creator/)
44
-
45
- html.css("div li").map(&:text)
39
+ element = document.css("li[data-testid=title-pc-principal-credit]").first
40
+ element&.text&.match?(/Director|Creator/) ? element.css("div li").map(&:text) : []
46
41
  end
47
42
 
48
43
  # list of genres (Array)
49
44
  def genres
50
- document.css("div[data-testid=genres] div a").map(&:text)
45
+ document.css("div[data-testid=interests] div a").map(&:text) || []
51
46
  end
52
47
 
53
48
  # ID that differentiates each media type on imdb.com (String)
@@ -62,7 +57,7 @@ module IMDb
62
57
 
63
58
  # list of production companies (Array)
64
59
  def production_companies
65
- document.css("li[data-testid=title-details-companies] li").map(&:text)
60
+ document.css("li[data-testid=title-details-companies] li").map(&:text) || []
66
61
  end
67
62
 
68
63
  # average ratings (String)
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ##
5
5
  ##
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### All features are available from Title class
8
8
 
9
9
  ## 1. duration
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ##
5
5
  ##
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### All features are available from Title class
8
8
  ##
9
9
  ##
@@ -11,5 +11,5 @@
11
11
 
12
12
  # features exclusive to Episode media type
13
13
  module Episode
14
- prepend NonInteractive
14
+ include NonInteractive
15
15
  end
data/lib/titles/movie.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ##
5
5
  ##
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### All features are available from Title class
8
8
  #### ------- BOX OFFICE ---------
9
9
  ### 12. Budget
@@ -14,7 +14,7 @@
14
14
 
15
15
  # features exclusive to Movie media type
16
16
  module Movie
17
- prepend NonInteractive
17
+ include NonInteractive
18
18
 
19
19
  # budget (String)
20
20
  def budget
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ##
5
5
  ##
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### All features are available from Title class
8
8
  ##
9
9
  ##
@@ -11,5 +11,5 @@
11
11
 
12
12
  # features exclusive to Tv-Show media type
13
13
  module TvShow
14
- prepend NonInteractive
14
+ include NonInteractive
15
15
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ##
5
5
  ##
6
- ###### ---------------- List of features/data avialable to extract -----------------------
6
+ ###### ---------------- List of features/data available to extract -----------------------
7
7
  ### All features are available from Title class
8
8
  ##
9
9
  ##
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imdb_title
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juzer Shakir
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
11
+ date: 2024-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -65,8 +65,9 @@ licenses:
65
65
  - MIT
66
66
  metadata:
67
67
  source_code_uri: https://github.com/JuzerShakir/imdb
68
- changelog_uri: https://github.com/JuzerShakir/imdb/CHANGELOG.md
69
- bug_tracker_uri: https://github.com/JuzerShakir/imdb/Issues
68
+ changelog_uri: https://github.com/JuzerShakir/imdb/blob/master/CHANGELOG.md
69
+ bug_tracker_uri: https://github.com/JuzerShakir/imdb/issues
70
+ rubygems_mfa_required: 'true'
70
71
  post_install_message:
71
72
  rdoc_options: []
72
73
  require_paths:
@@ -75,14 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
76
  requirements:
76
77
  - - ">="
77
78
  - !ruby/object:Gem::Version
78
- version: 2.7.0
79
+ version: '3.1'
79
80
  required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  requirements:
81
82
  - - ">="
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  requirements: []
85
- rubygems_version: 3.4.20
86
+ rubygems_version: 3.5.23
86
87
  signing_key:
87
88
  specification_version: 4
88
89
  summary: Access info of any Movie, Tv Show, Episode or Game from imdb.com