Chasing the Stars: My Journey with 'ISS Notifier Pro project 29
Do you ever look up at the night sky and wonder about the
International Space Station (ISS) orbiting high above? I know I do. That's what
led me on an incredible journey to create the 'ISS Notifier Pro,' a simple yet
thrilling Python project.
Where It All Began
It all started with a fascination for space, a love for
technology, and a desire to connect the two. I wanted to create something that
would bridge the gap between Earth and the cosmos - and that's when the 'ISS
Notifier Pro' was born.
Tracking the ISS
The heart of the 'ISS Notifier Pro' is its ability to track
the real-time location of the ISS. I turned to the 'Where the ISS at?' API for
this purpose. With just a few lines of code, I could fetch the ISS's latitude
and longitude as it zipped through space at over 27,000 kilometers per hour.
Finding My Spot on Earth
Of course, to notify me when the ISS was overhead, I needed
to know where I was on Earth. The 'geopy' library helped me determine my
location based on my address. With a latitude and longitude in hand, I was
ready for the next step.
The Magic of Calculation
One of the most fascinating parts of this project was the
calculation of the distance between my location and the ISS. I used the
Haversine formula, a method that's been used by navigators for centuries to
determine distances on a sphere. It's an impressive thought - that an age-old
formula can be used to calculate the distance to a space station!
The Thrill of a Notification
Finally, when the distance between me and the ISS was within
a certain range, I'd receive a notification on my device. The moment of excitement
when the notification appeared was worth every line of code written.
The Journey Continues
My journey with the 'ISS Notifier Pro' has been a thrilling
one. It's a reminder that with a bit of code and a lot of curiosity, you can
connect with the stars. If you've ever had a passion project or a tech dream, I
encourage you to pursue it. Who knows where it might take you?
What's Next?
Now, I'm open to exploring more features for the 'ISS
Notifier Pro' and potentially sharing it with the community. Whether it's
tracking other celestial objects or enhancing the user experience, the
possibilities are limitless.
Join Me in the Stars
If you're as intrigued by the 'ISS Notifier Pro' as I am,
feel free to reach out with questions, suggestions, or just to discuss the
wonders of space and technology. We're all stardust, and the universe is our
playground.
In the end, this project is a testament to what's possible
when you blend technology and a sense of wonder. The stars are not out of
reach; they're just a few lines of code away.
May we all continue chasing the stars. 🌌
Source code:
import smtplib
import requests
from datetime import datetime
MY_LAT = 38.199032
MY_LONG = -77.969650
# Finding current location of ISS through api
def is_iss_over_me():
response = requests.get(url='http://api.open-notify.org/iss-now.json')
response.raise_for_status()
data = response.json()
latitude = float(data['iss_position']['latitude'])
longitude = float(data['iss_position']['longitude'])
iss_location = (latitude, longitude)
if MY_LAT-5 <= latitude <= MY_LAT+5 and MY_LONG-5 <= longitude <= MY_LONG+5:
return True
# Putting in my location for getting sunrise and sunset time.
def is_night():
my_location = {
'lat': MY_LAT,
'lng': MY_LONG,
'formatted': 0,
}
response1 = requests.get(url='https://api.sunrise-sunset.org/json', params=my_location, )
response1.raise_for_status()
data1 = response1.json()
sunrise = int(data1['results']['sunrise'].split('T')[1].split(':')[0])
sunset = int(data1['results']['sunset'].split('T')[1].split(':')[0])
current_time = datetime.now()
current_time_hour = int(current_time.hour)
if current_time_hour >= sunset or current_time_hour <= sunrise:
return True
EMAIL = '********@gmail.com'
PASSWORD = '*******'
TO = '******@gmail.com'
while True:
if is_iss_over_me() and is_night():
with smtplib.SMTP("smtp.gmail.com") as connection:
connection.starttls()
connection.login(user=EMAIL, password=PASSWORD)
connection.sendmail(from_addr=EMAIL, to_addrs=TO, msg='Iss is over you')
#SpaceTech #ISS #PythonProgramming #PassionProject
#TechInnovation