Skip to content

Commit

Permalink
🐺 Add a new fact about our Universe
Browse files Browse the repository at this point in the history
  • Loading branch information
todd-the-bot authored Dec 21, 2023
1 parent b541a45 commit 876f8a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cygx1/command/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import click
from datetime import datetime

from cygx1.module.facts import Facts
from cygx1.module.nasa import Nasa
from cygx1.module.logger import Logger
from cygx1.module.checksum import Checksum
Expand All @@ -40,21 +41,23 @@ def __init__(self, file, platform):
self.platform = platform
self.file_system = FileSystem()
self.checksum = Checksum()
self.facts = Facts()
self.archive = Archive("archive.json")
self.logger = Logger().get_logger(__name__)

def run(self):
"""Run explorer"""

now = datetime.now()
formatted_date_time = now.strftime("%Y-%m-%d %H:%M:%S")

fact = self.facts.random_line('facts.txt').strip()

if self.platform == "nasa":
result = self.nasa.fetch(os.getenv('NASA_API_KEY'))
data = f"""<p align='center'>
<img src='{result['url']}' width='60%' />
<h3 align="center">Cygnus X-1</h3>
<p align="center">The immensity of the universe is difficult to grasp.</p>
<p align="center">{fact}</p>
</p>
<br/>
Expand Down

0 comments on commit 876f8a3

Please sign in to comment.