eztv 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6443f768a92e9e5fac65c6455d7b89283eb516e
4
- data.tar.gz: 0e59e5cd414b3a4d614650513f05a43054824744
3
+ metadata.gz: 8585bd0c2793a97f013034cc7c2c648810dd091c
4
+ data.tar.gz: 27827e33d1f19c555fa6218a373dd3af9bc8c42c
5
5
  SHA512:
6
- metadata.gz: 0eb05abb995c278043f42a7a229e2c5658cb5e2439bed628c378d9b1f72413c4acb624e10afd183ca395ea1fa381308c1413067c8d6b09ddf1893d4f97554c40
7
- data.tar.gz: d416f28539b91799cbfff861d4f113700adc2b73b826a77bf60cd0e64918f6958da46f33a734d4ac09d1e6fbdcc7ec96a180c6dcdba2ca6683683fea546e17a5
6
+ metadata.gz: 38097442f74dc0318efa90d5b39e5c5dcbb3488892e5c3fe71d0a3000500d74d0ad675b3a61dcba0babd0c83daab2f5a26e7ab394e674efd8fee3b5f3a58ea8d
7
+ data.tar.gz: 92550cb587ba5d07a2a7c8be951da7bed70a17c7b4c68f4b91e688b3ae7eebe86e1126b8b091128ea369a1b942733fb9161c68d5037ce4372c02ef10f7974e63
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # EZTV
2
+ [![Build Status](https://travis-ci.org/DamirSvrtan/eztv.svg?branch=master)](https://travis-ci.org/DamirSvrtan/eztv)
3
+ [![Gem Version](https://badge.fury.io/rb/eztv.svg)](http://badge.fury.io/rb/eztv)
2
4
 
3
5
  A Ruby scraper for the catastrophic EZTV API. It is not using the RSS feed since it doesn't work well, so it scrapes the search results.
4
6
 
@@ -18,22 +20,44 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
23
+ Fetch a series and get all the magnet links:
21
24
  ```ruby
25
+ require 'eztv'
26
+
22
27
  white_collar = EZTV::Series.new("white collar")
23
28
 
24
29
  white_collar.episodes.each do |episode|
25
30
  puts episode.magnet_link
26
31
  end
32
+ ```
33
+
34
+ Get all regular torrent download links from S01E01:
35
+
36
+ ```ruby
37
+ white_collar.episode(1,1).links
38
+ # ["//torrent.zoink.it/White.Collar.S01E01.Pilot.HDTV.XviD-FQM.[eztv].torrent",
39
+ # "http://www.mininova.org/tor/3077342",
40
+ # "http://www.bt-chat.com/download.php?info_hash=e0e74306adca549be19b147b5ee14bde1b99bb1d"]
41
+ ```
27
42
 
43
+ Get number of seasons or number of episodes per season:
44
+ ```ruby
28
45
  puts "Number of seasons: #{white_collar.seasons.count}"
29
46
  puts "Number of episodes in season 1: #{white_collar.season(1).count}"
47
+ ```
30
48
 
49
+ Get the last episode of the latest season in SxxExx format:
50
+ ```ruby
51
+ white_collar.episodes.last.s01e01_format
52
+ ```
53
+ There will be an error raised if you browsed for a non existing series:
54
+ ```ruby
31
55
  nonny = EZTV::Series.new("nonny")
32
56
  begin
33
57
  nonny.episodes
34
58
  rescue EZTV::SeriesNotFoundError => e
35
59
  puts e.message
36
- => "Unable to find 'nonny' on https://eztv.it."
60
+ # "Unable to find 'nonny' on https://eztv.it."
37
61
  end
38
62
  ```
39
63
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "eztv"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Damir Svrtan"]
9
9
  spec.email = ["damir.svrtan@gmail.com"]
10
10
  spec.summary = "EZTV wrapper in Ruby"
@@ -84,7 +84,7 @@ module EZTV
84
84
  end
85
85
 
86
86
  def s01e01_format
87
- @s01e01_format ||= "S" + season.to_s.rjust(2,'0') + "E" + season.to_s.rjust(2,'0')
87
+ @s01e01_format ||= "S" + season.to_s.rjust(2,'0') + "E" + episode_number.to_s.rjust(2,'0')
88
88
  end
89
89
  end
90
90
  end
@@ -19,10 +19,17 @@ class TestExistingSeries < Minitest::Test
19
19
 
20
20
  def test_first_episode
21
21
  first_episode = @white_collar.episodes.first
22
- assert_equal 1, first_episode.episode_number
23
22
  assert_equal 1, first_episode.season
23
+ assert_equal 1, first_episode.episode_number
24
24
  assert_equal "S01E01", first_episode.s01e01_format
25
25
  end
26
+
27
+ def test_latest_episode
28
+ first_episode = @white_collar.episodes.last
29
+ assert_equal 5, first_episode.season
30
+ assert_equal 13, first_episode.episode_number
31
+ assert_equal "S05E13", first_episode.s01e01_format
32
+ end
26
33
  end
27
34
 
28
35
  class TestNonExistingSeries < Minitest::Test
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eztv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damir Svrtan