NASA APOD (Astronomy Picture Of the Day)
IMPORTANT: - If you want to try this program you will need to get a NASA API key. It's VERY easy and free and will be issued on line. The program will guide you.
NASA has some fantastic photos and videos which have been put online daily since 1995. This program creates an easy way to locate, access and store these images.
As usual please let me know how you get on and if there are any issues.
NASA APOD
Re: NASA APOD
Hi Cogier, I just had 10mins over breakfast to download and start looking at this project.
When I "Click here to get your key" it returns:-
Code: Select all
/home/steve/https://api.nasa.gov/#signUp
I hope to find some time to look at this again next week (in 2020).
Happy New Year to one and all!
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: NASA APOD
Hi Steve,
Thanks for testing the program. I am at a loss as to why you are getting this problem as the code couldn't be much simpler.
AND a Happy New Year to you all!
Thanks for testing the program. I am at a loss as to why you are getting this problem as the code couldn't be much simpler.
AND a Happy New Year to you all!
- Got2BeFree
- Posts: 92
- Joined: Saturday 26th November 2016 2:52am
- Location: Lost
Re: NASA APOD
I had no issues when clicking the "get your key" button.
One issue I did run into though is the cache. Because I run a small /Home partition, most everything goes to a large "storage" partition and I then create links in /Home to those. When I seen where the cache was building up, I deleted the /NASA_APOD folder. When clicking the cache button again, an explosion occurred and my monitor melted into a pile of goo.
A nice fix would be to check for that /NASA_APOD folder and recreate again if needed. Another nice fix would be to give the user an option to change the location where that folder calls home since downloading HD images could chew up a lot of disk space quickly.
Something I felt was odd, is using a single click to view the image full screen. A double click would be much better and not prone to erroneous clicks inside the image viewing area.
Other than those two things, I think your app is great and I plan on using it to build up my wallpaper collection.
One issue I did run into though is the cache. Because I run a small /Home partition, most everything goes to a large "storage" partition and I then create links in /Home to those. When I seen where the cache was building up, I deleted the /NASA_APOD folder. When clicking the cache button again, an explosion occurred and my monitor melted into a pile of goo.
A nice fix would be to check for that /NASA_APOD folder and recreate again if needed. Another nice fix would be to give the user an option to change the location where that folder calls home since downloading HD images could chew up a lot of disk space quickly.
Something I felt was odd, is using a single click to view the image full screen. A double click would be much better and not prone to erroneous clicks inside the image viewing area.
Other than those two things, I think your app is great and I plan on using it to build up my wallpaper collection.
sholzy
I'm wondering around lost in the past, not knowing where the present is.
I'm wondering around lost in the past, not knowing where the present is.
Re: NASA APOD
I've just worked out that my problem is with the URLLabel, a control I'd never looked at or even noticed before.
I think there is a Linux command/dependancy that is missing from PeppermintOS, so when this control is clicked, I just get my home path appended to the web link.
I managed to hack the code by using the MouseDown event on a regular Label control:-
Public Sub getKeyLabel_MouseDown()
FMain.OpenFilePatched("https: //api.nasa.gov/#signUp")
End
{note: the gap bewteen ":" & "//" is just to stop the forum from creating HTML code}...and adding this Subroutine:-
Public Sub OpenFilePatched(path As String)
Shell "xdg-open " & path
End
As my Linux distribution has the command "xdg-open" it now works fine.Many thanks to my son Matt for his valuable help with this issue.
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: NASA APOD
Sholzy
Steve
Well done Matt and thank you all for the input!
OK sorry about that. I have removed the explosives and the monitor melting fluid and the program will now not crash if you delete the folder.One issue I did run into though is the cache. Because I run a small /Home partition, most everything goes to a large "storage" partition and I then create links in /Home to those. When I seen where the cache was building up, I deleted the /NASA_APOD folder. When clicking the cache button again, an explosion occurred and my monitor melted into a pile of goo.
Fixed in this version.A nice fix would be to check for that /NASA_APOD folder and recreate again if needed.
This looks like quite a bit of work and I have not found a way to access other Partitions/Drives from within Gambas. (Not fixed)Another nice fix would be to give the user an option to change the location where that folder calls home since downloading HD images could chew up a lot of disk space quickly.
I like the single click but you are right to bring this up so I have added an option in the attached version.Something I felt was odd, is using a single click to view the image full screen. A double click would be much better and not prone to erroneous clicks inside the image viewing area.
Steve
I can't fix that one, it's just too much I can't cope any more!....I think there is a Linux command/dependency that is missing from PeppermintOS
Use the 'Do not automatically parse URLs' check box and all will be OK{note: the gap between ":" & "//" is just to stop the forum from creating HTML code}
Public Sub getKeyLabel_MouseDown() FMain.OpenFilePatched("https: //api.nasa.gov/#signUp") End
Public Sub getKeyLabel_MouseDown()
FMain.OpenFilePatched("https://api.nasa.gov/#signUp")
End
I use the Gambas Desktop.Open() command, saves having to shell commands.As my Linux distribution has the command "xdg-open" it now works fine.
Well done Matt and thank you all for the input!
Re: NASA APOD
Great program cogier! I "lost" a big chunk of my morning just clicking from one image to another.
My only additional problems/comments:-
I think you should be able to load the program and view the Help before you get the api screen (this relates to my previous problem).
When I copy/paste the api key, the text changes to: <meta http-equiv="content-type" content="text/html; charset=utf-8"><code class="signup-key">eR5Pdmbrc6f8PcuyEyRzrxUoxnz66eKDgIVjeyjC</code>
...maybe I was doing something wrong, but it wasn't obvious.
When I clicked on image/video 22v (2019 Dec) the program crashed. So I think you need to add more error handlers, especially for DisplayPicture, and probably a few others including CreateFolder, GetData, videos & so on.
I got some clipped text:-
In Detailed Help you have a typo "...bottom o0f the form..."
Note: All testing done in the IDE using the 1st zipped file.
I hope this helps.
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: NASA APOD
Hi Steve,
Thanks for pointing out these issues. I have loaded up Xubuntu on my laptop and all these issues are showing up. I'm on it
You missed another error, it's in your photo. Both the buttons have a shortcut key of "C". Opps!
Thanks for pointing out these issues. I have loaded up Xubuntu on my laptop and all these issues are showing up. I'm on it
You missed another error, it's in your photo. Both the buttons have a shortcut key of "C". Opps!
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: NASA APOD
I had thought about that and decided against it, I have now added a 'Help' button to the 'api' Form that takes you straight to the correct 'Help' tab.I think you should be able to load the program and view the Help before you get the api screen (this relates to my previous problem).
I have just tried this on an Xubuntu installation and I got the same problem. Fixed. Changed Clipboard.Paste() to Clipboard.Paste("text/plain").When I copy/paste the api key, the text changes to: <meta http-equiv="content-type" content="text/html; charset=utf-8"><code class="signup-key">eR5Pdmbrc6f8PcuyEyRzrxUoxnz66eKDgIVjeyjC</code>
...maybe I was doing something wrong, but it wasn't obvious.
Sloppy programming on my part. I was relying in the video being on YouTube and this one wasn't! I am using the correct data now.When I clicked on image/video 22v (2019 Dec) the program crashed.
Fixed. Added 'Picture' to the buttons and changed the shortcut keys.I got some clipped text:-
Fixed.In Detailed Help you have a typo "...bottom o0f the form..."
Update attached
Thanks again for this.
- Got2BeFree
- Posts: 92
- Joined: Saturday 26th November 2016 2:52am
- Location: Lost
Re: NASA APOD
They say a picture is worth a thousand words...
Here's three-thousand words... Let's see if you can find the fourth problem common with all three images. Here's a hint... It's not what's written. Here's another hint... They say size matters.
The screen shots are full screen, not cut off.
Here's three-thousand words... Let's see if you can find the fourth problem common with all three images. Here's a hint... It's not what's written. Here's another hint... They say size matters.
The screen shots are full screen, not cut off.
sholzy
I'm wondering around lost in the past, not knowing where the present is.
I'm wondering around lost in the past, not knowing where the present is.