I wanted to know the closest place to go see the eclipse. So I programmed an AI app to look for it

Next August 12 I will be in Madrid, and that is a problem. And it is because Madrid will not be the optimal place to see the astronomical event of the century: the solar eclipse that that day will have millions of people watching the sky around 8:30 p.m.

My idea is to go see it with my family in a location where it can be seen in its entirety for as long as possible, but I would also like not to go too far. There is tools such as those of the National Geographic Institute They tell us what the eclipse will look like in each location, but I didn’t want to know that, but rather where to go to see it taking into account distance and travel time.

There may be tools that do something like this that I haven’t found, but yesterday, when thinking about the idea, I realized that I could actually try to make my own tool. AI models and platforms such as Claude Code, Codex, Antigravity, or OpenCode have already shown that almost anyone can turn an idea into an app, and as you know I was already amazed by the possibilities. Why not try it?

That’s just what I did. Try it. I told it yesterday on my personal blogand I also wanted to share the experience here. The first thing was to find out if something like this was feasible. There are several ways to solve that, but I tend to go with the “Deep Investigation” modes offered by current models. I wanted to try ChatGPT in its free version, which offers this possibility, and I made my proposal to him to find out if it was possible.

Screenshot 2026 06 30 At 11 04 10
Screenshot 2026 06 30 At 11 04 10

After eight minutes going through sources on the internet, he presented me with a really complete “executive summary” in which he confirmed, among other things, that there was a good set of data sources that I could use for the application: the IGN and the National Observatory, for example, have public resources with a CC-BY license, there are astronomical APIs such as OPALE (IMCCE) either USNO/APODwhile for routes to destination it suggested OSRMa fantastic and open platform for this type of function.

GLM-5.2 program like angels

With that information under my power, I began development with the AI ​​platforms and models that I have been using lately. This was also a perfect opportunity to test how it behaved the GLM-5.2 model from Z.ai. I have been subscribed to the platform for a few months—I took advantage of an offer at the end of last year—and now that they have launched this model I have been testing it with small experiments. The performance seemed fantastic and certainly close to what the Claude Opus 4.8 or GPT-5.5 offer, so This was a fantastic opportunity to see how GLM-5.2 solved the problem..

What I did was create a directory on my Mac mini M4 (original name, “eclipse”), go into it and launch Claude Code preselecting the model I intended to use (claude –model glm-5.2). Once the AI ​​agent was started for scheduling, I explained my conversation with ChatGPT, copied the executive summary, and gave him some more guidelines to start planning everything.

Screenshot 2026 06 30 At 11 25 59
Screenshot 2026 06 30 At 11 25 59

The conversation about the development of the project was long and GLM-5.2 ended up compacting it, but I asked him to show me a summary of that original plan. This was the idea.

GLM-5.2 is a model that “thinks” quite a bit, and I like that it does: it makes the responses much more precise and complete in my experience, so even that first plan took a few minutes to get ready. When he presented it I thought everything was fantastic. I reviewed it, but I’m not a developer, so I simply relied on GLM-5.2 when choosing technical options for the entire project and looked more at the requirements and objectives that the plan established.

I didn’t capture that part of the conversation and since I ended up “conversing” quite a bit later, Claude Code and GLM-5.2 compacted the conversation to avoid excessive token consumption. Even so, I have now asked him to show me what he had saved in that compaction, and that screenshot above shows a little what the idea for the development was.

Everything seemed perfect, I insist, so I told Claude Code / GLM-5.2 to get going. And boy did he do it: spent 42 minutes creating and editing files without me having to intervene at all. When he finished (again, I didn’t take a screenshot of the terminal) he showed me a summary of what he had done, and told me how I could test the project. A few small commands in a separate terminal window to launch the web application and voila: I could now see the project in my browser. The first look left me stunned: the thing was promising.

Eclipse 1
Eclipse 1

This is what I saw when I first opened the project in my browser. Some mistakes, yes, but nothing bad.

I found the interface spectacular, but after a few seconds I began to detect errors. The “Distance” shown in the “Journey” part was unrealistic, and the locations chosen from Madrid were much further away than I had assumed. For some reason I had made some incorrect decisions when choosing these locations, so I started “chatting” with GLM-5.2 in Claude Code to correct everything.

That process was entertaining and trivial: I told him what was wrong (“you are showing very distant destinations, a good option for example from Madrid is Lerma and you don’t show it”), and from there GLM-5.2 thought and thought to make its modifications. He presented them to me, I reviewed them and started again.

After three or four attempts and another half hour of tests, things were already very clear. The recommendations from Madrid were great, and I considered several options in which I prioritized time to arrive (highway/highway) over distance, and of course, time of totality of the eclipse: the closer you get to that “ideal line” of passage of the star, the longer the total eclipse lasts, but what you gain by traveling 100 km may not be worth seeing 10 more seconds of the eclipse.

I discussed all of this normally with the model to refine the recommendations, and in fact he suggested additional improvements, such as show totality stripes that allow you to check which area of ​​the map is where the solar eclipse is seen the most and best. That, together with showing the routes more clearly or a small dialog box so that each route showed appropriate information, ended up rounding off this initial version.

Eclipse Glm 2
Eclipse Glm 2

Totality strips ready, distances already corrected and coherent both on the map and in the sidebar.

With this part of the project resolved, I decided that the tool could also be useful to other users, so I added the ability to choose the location of origin. GLM-5.2 went to work again to include a small text box in the top left where you could put that location.

Without me asking, when I tried it I saw how some locations autocomplete, although not all. The curious thing is that if you put one that exists, even if it does not autocomplete, the origin is detected correctly and it looks for the closest points to see the eclipse. If the location is already in the perfect zone of totality, it displays an informative message: you don’t have to move, you will see the eclipse perfectly there.

Eclipse Barcelona
Eclipse Barcelona

I did some tests with Barcelona as the origin, and at first things failed because showed points too far apart. The AI ​​model reanalyzed what was happening and found the problem, then corrected it and came up with much more reasonable options.

Barcelona Eclipse Corrections
Barcelona Eclipse Corrections

Here again I trust that the technical decisions work, and although it seems that there could be other locations that could be good candidates, the system seems to behave as I designed it: the important thing is to shorten the duration of the trip and that the eclipse looks perfect for a long time.

The result, as you can see, is attractive and seems quite useful. GLM-5.2 suggested me some additional improvementssuch as checking traffic and weather information before the eclipse, but since the event is still six weeks away, I left the project as it was.

He also proposed making a kind of “shadow map”, something that he may implement because we must take into account that the eclipse will occur at a time when the sun will be close to setting: we must make sure that buildings, trees or geographical features do not impede vision. This seems somewhat more complicated to calculate, but it will have to be taken into account once the destination has been chosen.

Refactor
Refactor

With everything resolved, it was time for the final review and improvement: refactor the code and check if it was safe. I asked GLM-5.2 for improvements to the code to make it more efficient, and it found several places to make some changes. Then I wanted to verify the security of the project, and again GLM-5.2 carried out an analysis of it to verify that everything was correct.

Once that is completed, I published the code on GitHub so that anyone interested can take advantage of it. If you feel like it, you can try it, modify it or create your own fork from it. The last thing I did was deploy it to an unimaginative subdomain (eclipse.javipas.com) so anyone can try it.

Eclipse Javipas Glm 5 2
Eclipse Javipas Glm 5 2

The project is by no means perfect, but I thought it was a great experiment to test the power of GLM-5.2. The result really surprised me, and there you have it in case you want to try it or work on it. Without a doubt, further proof that nowadays turning an idea into an app, even if it is imperfect, It is almost within reach of anyone. Enjoy the eclipse!

In Xataka | Puertomingalvo, the Teruel town of 130 inhabitants that has been without free beds for the eclipse for more than a year

Leave your vote

Leave a Comment

GIPHY App Key not set. Please check settings

Log In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Add to Collection

No Collections

Here you'll find all collections you've created before.