apiverve_sunrisesunset 1.2.3 → 1.2.5
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 +4 -4
- data/README.md +33 -16
- data/lib/apiverve_sunrisesunset/client.rb +2 -2
- data/lib/apiverve_sunrisesunset.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7dc84186bc70e9d0e7341e90506230195390165009f4fb2554a72e171b51752
|
|
4
|
+
data.tar.gz: 900c5080e5176e362685db7f41c82f2b1b67991adc872dc5a188363910a75fdf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 897fcd2e3d3fe5f483625ab8b3bbb10b38b5007b96b13595e616b71c181c0f9aad3f7c005f22629ec03d820d84a93b830ee099b8c6935d19de6b02e3a0de8f42
|
|
7
|
+
data.tar.gz: 35325e0b1dce64ba1fd4d27d0beec331232a170499d1663b461c712e0903040559612ebebed9cef4b971cdaef49de8a821c8bfd493c89b2d627c70b55befc166
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sunrise Sunset API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Sunrise Sunset calculates exact sunrise and sunset times, twilight stages, and golden hour windows for any latitude and longitude coordinates. Paid plans can specify custom dates and receive solar noon.
|
|
3
|
+
Sunrise Sunset calculates exact sunrise and sunset times, twilight stages, and golden hour windows for any latitude and longitude coordinates. Paid plans can specify custom dates and receive solar noon. With local=true, the response names the IANA timezone of the coordinates on any plan, and paid plans also get each time in local time with its UTC offset.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -38,7 +38,8 @@ client = APIVerve::Sunrisesunset::Client.new(api_key: "YOUR_API_KEY")
|
|
|
38
38
|
response = client.execute({
|
|
39
39
|
lat: 36.72016,
|
|
40
40
|
lon: -4.42034,
|
|
41
|
-
date: "01-16-2026"
|
|
41
|
+
date: "01-16-2026",
|
|
42
|
+
local: true
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
# Print the response
|
|
@@ -50,7 +51,7 @@ puts response
|
|
|
50
51
|
|
|
51
52
|
```ruby
|
|
52
53
|
begin
|
|
53
|
-
response = client.execute({ lat: 36.72016, lon: -4.42034, date: "01-16-2026" })
|
|
54
|
+
response = client.execute({ lat: 36.72016, lon: -4.42034, date: "01-16-2026", local: true })
|
|
54
55
|
puts response["data"]
|
|
55
56
|
rescue APIVerve::Sunrisesunset::ValidationError => e
|
|
56
57
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -77,19 +78,35 @@ client = APIVerve::Sunrisesunset::Client.new(
|
|
|
77
78
|
"status": "ok",
|
|
78
79
|
"error": null,
|
|
79
80
|
"data": {
|
|
80
|
-
"solarNoon": "
|
|
81
|
-
"sunrise": "
|
|
82
|
-
"sunset": "
|
|
83
|
-
"sunriseEnd": "
|
|
84
|
-
"sunsetStart": "
|
|
85
|
-
"dawn": "
|
|
86
|
-
"dusk": "
|
|
87
|
-
"nauticalDawn": "
|
|
88
|
-
"nauticalDusk": "
|
|
89
|
-
"nightEnd": "
|
|
90
|
-
"night": "
|
|
91
|
-
"goldenHourEnd": "
|
|
92
|
-
"goldenHour": "
|
|
81
|
+
"solarNoon": "2026-01-16T12:28:27.256Z",
|
|
82
|
+
"sunrise": "2026-01-16T07:30:14.174Z",
|
|
83
|
+
"sunset": "2026-01-16T17:26:40.338Z",
|
|
84
|
+
"sunriseEnd": "2026-01-16T07:33:11.786Z",
|
|
85
|
+
"sunsetStart": "2026-01-16T17:23:42.726Z",
|
|
86
|
+
"dawn": "2026-01-16T07:02:03.459Z",
|
|
87
|
+
"dusk": "2026-01-16T17:54:51.053Z",
|
|
88
|
+
"nauticalDawn": "2026-01-16T06:30:17.010Z",
|
|
89
|
+
"nauticalDusk": "2026-01-16T18:26:37.502Z",
|
|
90
|
+
"nightEnd": "2026-01-16T05:59:14.883Z",
|
|
91
|
+
"night": "2026-01-16T18:57:39.629Z",
|
|
92
|
+
"goldenHourEnd": "2026-01-16T08:09:09.341Z",
|
|
93
|
+
"goldenHour": "2026-01-16T16:47:45.171Z",
|
|
94
|
+
"timezone": "Europe/Madrid",
|
|
95
|
+
"localTimes": {
|
|
96
|
+
"solarNoon": "2026-01-16T13:28:27+01:00",
|
|
97
|
+
"sunrise": "2026-01-16T08:30:14+01:00",
|
|
98
|
+
"sunset": "2026-01-16T18:26:40+01:00",
|
|
99
|
+
"sunriseEnd": "2026-01-16T08:33:11+01:00",
|
|
100
|
+
"sunsetStart": "2026-01-16T18:23:42+01:00",
|
|
101
|
+
"dawn": "2026-01-16T08:02:03+01:00",
|
|
102
|
+
"dusk": "2026-01-16T18:54:51+01:00",
|
|
103
|
+
"nauticalDawn": "2026-01-16T07:30:17+01:00",
|
|
104
|
+
"nauticalDusk": "2026-01-16T19:26:37+01:00",
|
|
105
|
+
"nightEnd": "2026-01-16T06:59:14+01:00",
|
|
106
|
+
"night": "2026-01-16T19:57:39+01:00",
|
|
107
|
+
"goldenHourEnd": "2026-01-16T09:09:09+01:00",
|
|
108
|
+
"goldenHour": "2026-01-16T17:47:45+01:00"
|
|
109
|
+
}
|
|
93
110
|
}
|
|
94
111
|
}
|
|
95
112
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Sunrisesunset::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ lat: 36.72016, lon: -4.42034, date: "01-16-2026" })
|
|
13
|
+
# response = client.execute({ lat: 36.72016, lon: -4.42034, date: "01-16-2026", local: true })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/sunrisesunset?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'lat' => { type: 'number', required: true, min: -90, max: 90 }, 'lon' => { type: 'number', required: true, min: -180, max: 180 }, 'date' => { type: 'string', required: false, format: 'date' } }
|
|
22
|
+
VALIDATION_RULES = { 'lat' => { type: 'number', required: true, min: -90, max: 90 }, 'lon' => { type: 'number', required: true, min: -180, max: 180 }, 'date' => { type: 'string', required: false, format: 'date' }, 'local' => { type: 'boolean', required: false, format: 'timezone' } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_sunrisesunset
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -60,7 +59,9 @@ dependencies:
|
|
|
60
59
|
version: '2.0'
|
|
61
60
|
description: Sunrise Sunset calculates exact sunrise and sunset times, twilight stages,
|
|
62
61
|
and golden hour windows for any latitude and longitude coordinates. Paid plans can
|
|
63
|
-
specify custom dates and receive solar noon.
|
|
62
|
+
specify custom dates and receive solar noon. With local=true, the response names
|
|
63
|
+
the IANA timezone of the coordinates on any plan, and paid plans also get each time
|
|
64
|
+
in local time with its UTC offset.
|
|
64
65
|
email:
|
|
65
66
|
- hello@apiverve.com
|
|
66
67
|
executables: []
|
|
@@ -79,7 +80,6 @@ metadata:
|
|
|
79
80
|
source_code_uri: https://github.com/apiverve/sunrisesunset-API/tree/main/ruby
|
|
80
81
|
changelog_uri: https://apiverve.com/changelog
|
|
81
82
|
documentation_uri: https://docs.apiverve.com/ref/sunrisesunset
|
|
82
|
-
post_install_message:
|
|
83
83
|
rdoc_options: []
|
|
84
84
|
require_paths:
|
|
85
85
|
- lib
|
|
@@ -94,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
96
|
requirements: []
|
|
97
|
-
rubygems_version:
|
|
98
|
-
signing_key:
|
|
97
|
+
rubygems_version: 4.0.23
|
|
99
98
|
specification_version: 4
|
|
100
99
|
summary: Sunrise Sunset API - Ruby Client
|
|
101
100
|
test_files: []
|