iptv-org-pro-url-tools 0.2.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d707edf922a8a37d92c4bcbb2e149443fc6cddc54b5f8780211a8f6ab251c91d
4
+ data.tar.gz: ac348fc496e7c642cf5c99685aa281ff48290fd471b55e70aea480c4f7df167b
5
+ SHA512:
6
+ metadata.gz: 3f5192c7366f34aeb20e4290e9c2739038c279bcd342757517074f0a5ab6225c600ba4d8baf36e983356ed34f99b683869826685b09775caaf8bafba9f23c8bb
7
+ data.tar.gz: 228f8990a2cf3fd62561bddb469189eec8f7e8692d1443f872235f191ab253d8485bf6eaa586b19cca30caadce062a25e56c0830775d3fd8e9eccdd24b15faa3
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bbwdadfg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # iptv-org-pro-url-tools (Ruby)
2
+
3
+ Offline URL helpers for the [iptv-org pro](https://iptv-org.pro/) public channel directory.
4
+
5
+ ## License
6
+
7
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,30 @@
1
+ require 'cgi'
2
+
3
+ module IptvOrgProUrlTools
4
+ BASE_URL = 'https://iptv-org.pro'.freeze
5
+ module_function
6
+
7
+ def metadata
8
+ { name: 'iptv-org pro', homepage: BASE_URL,
9
+ description: 'Independent public television channel directory URL helpers.',
10
+ canonical_pages: { home: home_url, channels: channels_url, countries: countries_url,
11
+ categories: categories_url, about: about_url, attribution: attribution_url },
12
+ tags: %w[television channels directory] }
13
+ end
14
+
15
+ def home_url = "#{BASE_URL}/"
16
+ def channels_url = "#{BASE_URL}/channels/"
17
+ def countries_url = "#{BASE_URL}/countries/"
18
+ def categories_url = "#{BASE_URL}/categories/"
19
+ def about_url = "#{BASE_URL}/about/"
20
+ def attribution_url = "#{BASE_URL}/attribution/"
21
+ def search_url(query) = "#{BASE_URL}/search/?q=#{encode(query)}"
22
+ def country_url(code) = "#{BASE_URL}/countries/#{encode(code)}/"
23
+ def category_url(category) = "#{BASE_URL}/categories/#{encode(category)}/"
24
+ def channel_url(country, slug) = "#{BASE_URL}/channels/#{encode(country)}/#{encode(slug)}/"
25
+
26
+ def encode(value)
27
+ CGI.escape(value.to_s).gsub('+', '%20')
28
+ end
29
+ private_class_method :encode
30
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iptv-org-pro-url-tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - bbwdadfg
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Offline URL helpers for the iptv-org pro public television directory.
13
+ executables: []
14
+ extensions: []
15
+ extra_rdoc_files: []
16
+ files:
17
+ - LICENSE
18
+ - README.md
19
+ - lib/iptv_org_pro_url_tools.rb
20
+ homepage: https://iptv-org.pro/
21
+ licenses:
22
+ - MIT
23
+ metadata:
24
+ homepage_uri: https://iptv-org.pro/
25
+ source_code_uri: https://github.com/bbwdadfg/iptv-org-pro-url-tools
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 4.0.11
41
+ specification_version: 4
42
+ summary: Offline URL helpers for iptv-org pro
43
+ test_files: []