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 +4 -4
- data/README.md +1 -1
- data/lib/kijkwijzer/result.rb +3 -7
- data/lib/kijkwijzer/version.rb +1 -1
- data/lib/kijkwijzer.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ccaf663b48a083c94144acc052165545b698daa
|
4
|
+
data.tar.gz: ed918806e56a702cb17c4c5e4fa8f739245713b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
|
data/lib/kijkwijzer/result.rb
CHANGED
@@ -12,13 +12,9 @@ module Kijkwijzer
|
|
12
12
|
@ratings.collect do |rating|
|
13
13
|
rating = rating.to_s.downcase
|
14
14
|
rv = nil
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
data/lib/kijkwijzer/version.rb
CHANGED
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"
|