kijkwijzer 0.1.1 → 0.1.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: b209b4c4e789335dcd55660460babce377f4dd8f
4
- data.tar.gz: c11814b1549ea455d10f4ee15b2c093265e0bb3c
3
+ metadata.gz: 1ccaf663b48a083c94144acc052165545b698daa
4
+ data.tar.gz: ed918806e56a702cb17c4c5e4fa8f739245713b4
5
5
  SHA512:
6
- metadata.gz: f17b634e82c6c35959fe0ec7119a90b93355833cf19b5d55889965473be69d694f593ddae152f0b5c2c302de3a8e60a7d3d0275db05bf38546bddd23b3db23cb
7
- data.tar.gz: 0288bf24e007af2f6d682f0d95c748afd26494ca4d00ae7c1ea79a6087c93f6c3cf35d71686dc013c8008ec13434d85ec7e5282ce91bac82ebff57be0d2eba53
6
+ metadata.gz: f2d72d83c3e7d1b4b9d5dba84f4e848f953c78f17caf55e58a64b01505bc92ed49dfea2219bee1a96b81546158e12c8ae6a1d7c5bd5596388e44e1cef3e6d0c5
7
+ data.tar.gz: 149ecdb65b5ce0d97311498a8207fe99713ada3735e34808c9fb86bea855db9f9b939c3786c2b5750159bf761b1e8f68043d36f57347224d8df91d31914e39da
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Kijkwijzer
2
2
 
3
- [Kijkwijzer](http://kijkwijzer.nl) is the [Dutch film/television-screening system](https://en.wikipedia.org/wiki/Television_content_rating_systems#Netherlands). Since there is no proper API i made this gem to remove the scraping bit from my own app-source.
3
+ [Kijkwijzer](http://kijkwijzer.nl) is the [Dutch film/television-screening system](https://en.wikipedia.org/wiki/Television_content_rating_systems#Netherlands). Since there is no proper API, this gem was made to remove the scraping bit from my own app-source. Additionally some helper methods have been added to make displaying the icons easier (the icons are included in this gem as a SVG-iconset).
4
4
 
5
5
  ## Installation
6
6
 
@@ -12,13 +12,9 @@ module Kijkwijzer
12
12
  @ratings.collect do |rating|
13
13
  rating = rating.to_s.downcase
14
14
  rv = nil
15
- rv = rating if ["al","6","9","12","16"].include? rating
16
- rv = "violence" if ["violence","g"].include? rating
17
- rv = "scary" if ["scary","a"].include? rating
18
- rv = "sex" if ["sex","s"].include? rating
19
- rv = "drugs" if ["drugs","h"].include? rating
20
- rv = "discrimination" if ["discrimination","d"].include? rating
21
- rv = "language" if ["language","t"].include? rating
15
+ Kijkwijzer::POSSIBLE_RATINGS.each do |pr|
16
+ rv = pr[:value] if (rating == pr[:value] or rating == pr[:code])
17
+ end
22
18
  rv
23
19
  end.compact
24
20
  end
@@ -1,3 +1,3 @@
1
1
  module Kijkwijzer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/kijkwijzer.rb CHANGED
@@ -6,6 +6,19 @@ require 'kijkwijzer/result'
6
6
  require 'kijkwijzer/railtie' if defined?(Rails)
7
7
 
8
8
  module Kijkwijzer
9
+ POSSIBLE_RATINGS = [
10
+ {name: "Alle leeftijden", value: "al", code: "al"},
11
+ {name: "6 jaar en ouder", value: "6", code: "6"},
12
+ {name: "9 jaar en ouder", value: "9", code: "9"},
13
+ {name: "12 jaar en ouder", value: "12", code: "12"},
14
+ {name: "16 jaar en ouder", value: "16", code: "16"},
15
+ {name: "Geweld", value: "violence", code: "g"},
16
+ {name: "Angst", value: "scary", code: "a"},
17
+ {name: "Seks", value: "sex", code: "s"},
18
+ {name: "Discriminatie", value: "discrimination", code: "d"},
19
+ {name: "Drugs en/of alcoholmisbruik", value: "drugs", code: "h"},
20
+ {name: "Grof taalgebruik", value: "language", code: "t"}
21
+ ]
9
22
  class << self
10
23
  def search_url(search)
11
24
  "http://www.kijkwijzer.nl/index.php?id=3__i&searchfor=#{url_encode(search)}&tab=KIJKWIJZER"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kijkwijzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Brouwers