Skip to content

Commit 18287df

Browse files
committed
TLAB - Set expiryDate on SL API pages. Update warningmessages and handle "no affects" in BetterUptime response.
1 parent 2071a85 commit 18287df

File tree

8 files changed

+44
-38
lines changed

8 files changed

+44
-38
lines changed

content/api/our-apis/sl/_index.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,30 @@ cascade:
88
- image: '/media/2024/09/banner_pendeltag.jpg'
99
- image_position: 'bottom'
1010
---
11-
SL's APIs is a collection of 7 APIs which provide information about planned and realtime traffic.
11+
12+
{{% warning %}}
13+
The current versions of SL RoutePlanner, SL Stop Lookup and SL Nearby Stops 2 will be shut down on the 30th of june
14+
2025. Since they are being replaced by [SL Journey Planner v2](journey-planner-2.md)
15+
{{% /warning %}}
16+
17+
SL's APIs is a collection of 3 APIs which provide information about planned and realtime traffic.
1218

1319
{{% info %}}
14-
SL has updated their API's. 7 API's have become 5:
20+
SL has updated their API's. 7 API's have become 3:
1521
<ul>
1622
<li>SL Transport (new: has replaced Departures v4 & Stops and lines v2)
1723
<li>SL Deviations (new: has replaced Service Alerts & Traffic Status)
18-
<li>SL Route-planner v3.1 (updated: new url)
19-
<li>SL Stop lookup (updated: new url)
20-
<li>SL Nearby stops 2 (updated: new url)
24+
<li>SL Journeyplanner (new: has replaced Route-planner, Stop lookup and SL Nearby stops)</li>
2125
</ul>
2226
{{% /info %}}
2327

24-
| Well suited for | Not so suited for |
25-
| :--- | :--- |
26-
| Quickly getting the next departures from a stop | Analysing public transport information |
27-
| Quickly calculating a route from A to B | Applications requiring huge amounts of API calls |
28-
| Digital Signage | Data visualisation |
29-
| Mobile applications | Building your own route-planner algorithm |
30-
| Websites | |
28+
| Well suited for | Not so suited for |
29+
|:------------------------------------------------|:-------------------------------------------------|
30+
| Quickly getting the next departures from a stop | Analysing public transport information |
31+
| Quickly calculating a route from A to B | Applications requiring huge amounts of API calls |
32+
| Digital Signage | Data visualisation |
33+
| Mobile applications | Building your own route-planner algorithm |
34+
| Websites | |
3135

3236
{{% info %}} SL's APIs only offer data for SL's traffic. [ResRobot](/api/our-apis/resrobot-v21/) offers the same data for
3337
entire Sweden. {{% /info %}}

content/api/our-apis/sl/nearby-stops-2.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
title: SL Nearby stops 2
33
weight: 300
44
date: 2019-01-14
5+
expiryDate: 2025-07-01
56

67
---
78

89
## Description
910

10-
{{% info %}}
11-
A new version of this API is currently being developed by SL. In order to ensure that the new version fits the needs of
12-
all users and use cases, SL wants to hear from you on what must be included in this new version. Please contact us
13-
at [info@Trafiklab.se](mailto:info@trafiklab.se) to contribute.
14-
{{% /info %}}
11+
{{% warning %}}
12+
This API is being replaced by [SL Journey Planner v2](journey-planner-2.md) and will be shut down on the 30th of june 2025.
13+
{{% /warning %}}
1514
Using this API, you can find SL stops near a pair of coordinates.
1615

1716
## URL

content/api/our-apis/sl/nearby-stops-2.sv.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: SL Nearby stops v2.0 (Närliggande hållplatser 2)
33
weight: 300
44
date: 2019-01-14
5+
expiryDate: 2025-07-01
56
aliases:
67
- /api/sl-narliggande-hallplatser-2
78
- /api/sl-narliggande-hallplatser-2/dokumentation
@@ -15,11 +16,9 @@ aliases:
1516

1617
## Beskrivning
1718

18-
{{% info %}}
19-
En ny version av detta API håller för närvarande på att utvecklas av SL. För att säkerställa att den nya versionen
20-
uppfyller behoven hos alla användare och användningsfall vill SL gärna höra från dig om vad som måste ingå i den nya
21-
versionen. Vänligen kontakta oss på [info@Trafiklab.se](mailto:info@trafiklab.se) för att bidra.
22-
{{% /info %}}
19+
{{% warning %}}
20+
Detta API ersätts av [SL Journey Planner v2](journey-planner-2.md) och kommer stängas ner den 30e juni 2025.
21+
{{% /warning %}}
2322

2423
Med detta API kan du få information om närliggande hållplatser till en försedd plats baserad på lat och long.
2524

content/api/our-apis/sl/route-planner-31.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: SL Route-planner v3.1
33
weight: 100
44
date: 2019-01-14
5+
expiryDate: 2025-07-01
56
aliases:
67
- /api/sl-reseplanerare-31
78
- /api/sl-reseplanerare-31/documentation

content/api/our-apis/sl/route-planner-31.sv.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: SL Reseplanerare 3.1
33
weight: 100
44
date: 2019-01-14
5+
expiryDate: 2025-07-01
56
---
67

78
## Beskrivning

content/api/our-apis/sl/stop-lookup.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: SL Stop lookup
33
weight: 200
44
date: 2014-03-14
5+
expiryDate: 2025-07-01
56
aliases:
67
- /api/sl-platsuppslag
78
- /api/sl-platsuppslag/dokumentation
@@ -16,11 +17,9 @@ aliases:
1617

1718
## Description
1819

19-
{{% info %}}
20-
A new version of this API is currently being developed by SL. In order to ensure that the new version fits the needs of
21-
all users and use cases, SL wants to hear from you on what must be included in this new version. Please contact us
22-
at [info@Trafiklab.se](mailto:info@trafiklab.se) to contribute.
23-
{{% /info %}}
20+
{{% warning %}}
21+
This API is being replaced by [SL Journey Planner v2](journey-planner-2.md) and will be shut down on the 30th of june 2025.
22+
{{% /warning %}}
2423

2524
Using this API, you can retrieve information regarding SLs stops by providing a part of the name of a stop. You can opt to only search for stops, or to search
2625
for both stops, addresses and places.

content/api/our-apis/sl/stop-lookup.sv.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
title: SL Stop lookup v1.0 (Platsuppslag)
33
weight: 200
44
date: 2014-03-14
5+
expiryDate: 2025-07-01
56

67
---
78

89
## Beskrivning
910

10-
{{% info %}}
11-
En ny version av detta API håller för närvarande på att utvecklas av SL. För att säkerställa att den nya versionen
12-
uppfyller behoven hos alla användare och användningsfall vill SL gärna höra från dig om vad som måste ingå i den nya
13-
versionen. Vänligen kontakta oss på [info@Trafiklab.se](mailto:info@trafiklab.se) för att bidra.
14-
{{% /info %}}
11+
{{% warning %}}
12+
Detta API ersätts av [SL Journey Planner v2](journey-planner-2.md) och kommer stängas ner den 30e juni 2025.
13+
{{% /warning %}}
1514

1615
Med detta API kan du få information om en plats genom att skicka in delar av platsens namn. Du kan välja mellan att bara
1716
söka efter hållplatsområden eller hållplatser, adresser och platser.

themes/trafiklab-2024/layouts/partials/js/betteruptime.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@
3232
let startingTimeUtc = statusReport.starts_at;
3333
let startingTimeFormatted = formatTimeStamp(startingTimeUtc);
3434

35-
let numberOfAffectedResources = statusReport.affected_resources.length;
36-
let firstAffectedResource = statusReport.affected_resources[0].name;
37-
let message;
38-
if (numberOfAffectedResources > 1) {
39-
message = firstAffectedResource + " + " + (numberOfAffectedResources - 1) + " other"
35+
let numberOfAffectedResources = statusReport.affected_resources?.length;
36+
if (numberOfAffectedResources) {
37+
let firstAffectedResource = statusReport.affected_resources[0].name;
38+
let message;
39+
if (numberOfAffectedResources > 1) {
40+
message = firstAffectedResource + " + " + (numberOfAffectedResources - 1) + " other"
41+
} else {
42+
message = firstAffectedResource;
43+
}
4044
} else {
41-
message = firstAffectedResource;
45+
message = statusReport.title;
4246
}
4347

4448
let html = createHtml(link, "Scheduled maintenance", startingTimeFormatted + '; ' + message)

0 commit comments

Comments
 (0)