Skip to content

Commit 0674ad8

Browse files
authored
🔀 Merge pull request #745 from k073l/FEATURE/735_apod_update
Replace APOD API with new one Fixes #735
2 parents dbb261c + 45900da commit 0674ad8

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/components/Widgets/Apod.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<div class="apod-wrapper" v-if="image">
2+
<div class="apod-wrapper" v-if="url">
33
<a :href="link" class="title" target="__blank" title="View Article">
44
{{ title }}
55
</a>
6-
<a :href="hdImage" title="View HD Image" class="picture" target="__blank">
7-
<img :src="image" :alt="title" />
6+
<a :href="hdurl" title="View HD Image" class="picture" target="__blank">
7+
<img :src="url" :alt="title" />
88
</a>
99
<p class="copyright">{{ copyright }}</p>
10-
<p class="description">{{ truncatedDescription }}</p>
10+
<p class="explanation">{{ truncatedExplanation }}</p>
1111
<p @click="toggleShowFull" class="expend-details-btn">
12-
{{ showFullDesc ? $t('widgets.general.show-less') : $t('widgets.general.show-more') }}
12+
{{ showFullExp ? $t('widgets.general.show-less') : $t('widgets.general.show-more') }}
1313
</p>
1414
</div>
1515
</template>
@@ -24,17 +24,17 @@ export default {
2424
data() {
2525
return {
2626
title: null,
27-
image: null,
28-
hdImage: null,
29-
link: null,
30-
description: null,
27+
url: null,
28+
hdurl: null,
29+
link: 'https://apod.nasa.gov/apod/astropix.html',
30+
explanation: null,
3131
copyright: null,
32-
showFullDesc: false,
32+
showFullExp: false,
3333
};
3434
},
3535
computed: {
36-
truncatedDescription() {
37-
return this.showFullDesc ? this.description : `${this.description.substring(0, 100)}...`;
36+
truncatedExplanation() {
37+
return this.showFullExp ? this.explanation : `${this.explanation.substring(0, 100)}...`;
3838
},
3939
},
4040
methods: {
@@ -52,14 +52,14 @@ export default {
5252
},
5353
processData(data) {
5454
this.title = data.title;
55-
this.image = data.url;
56-
this.hdImage = data.hdurl;
57-
this.link = data.apod_site;
58-
this.description = data.description;
55+
this.url = data.url;
56+
this.hdurl = data.hdurl;
57+
this.link = data.link;
58+
this.explanation = data.explanation;
5959
this.copyright = data.copyright;
6060
},
6161
toggleShowFull() {
62-
this.showFullDesc = !this.showFullDesc;
62+
this.showFullExp = !this.showFullExp;
6363
},
6464
},
6565
};
@@ -85,7 +85,7 @@ export default {
8585
opacity: var(--dimming-factor);
8686
color: var(--widget-text-color);
8787
}
88-
p.description {
88+
p.explanation {
8989
color: var(--widget-text-color);
9090
font-size: 1rem;
9191
margin: 0.5rem 0;

src/utils/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ module.exports = {
217217
/* API endpoints for widgets that need to fetch external data */
218218
widgetApiEndpoints: {
219219
anonAddy: 'https://app.anonaddy.com',
220-
astronomyPictureOfTheDay: 'https://apodapi.herokuapp.com/api',
220+
astronomyPictureOfTheDay: 'https://go-apod.herokuapp.com/apod',
221221
blacklistCheck: 'https://api.blacklistchecker.com/check',
222222
codeStats: 'https://codestats.net/',
223223
covidStats: 'https://disease.sh/v3/covid-19',

0 commit comments

Comments
 (0)