Inspiration
I don't see many of my peers who are interested in staying updated about NASA and space exploration. It is partly because my generation likes the news to be served to them on our favorite platform(s). Hopefully, my program can inspire people of my generation to research more about space technology and exploration during these Artemis missions.
The Solution
I created a bot that runs in the popular chatting app, Discord, which is more popular among the students of the Artemis generation. My hope is that the NASA News Discord Bot will inspire the younger generation to explore more in the field of space and related technologies.
What it does
The NASA News Discord Bot shows the five most recent NASA News articles with their summary and an AI-generated funny image based on the top article title. The bot runs in Discord and uses slash commands.
How I built it
- I used the Discord.py library to set up the main bot.
- I created a web scraper to extract articles (titles, full texts, and images) from the NASA News website.
- Used the MeaningCloud API to create a brief summary of each article.
- Used the DeepAI API to create funny images based on the title of the most recent article.
- Supports Discord slash commands so users can easily get articles and data.
Challenges I ran into
This was a solo project, so I had to manage my time in order to have a demonstratable program by the deadline. One of the biggest issues I ran into was that NASA did not have an API to retrieve their latest news, so I had to create my own web scraper. I also had to work around Discord.py's limits. For example, Discord.py has issues with messages timing out. In order to deal with this issue, I saved all the article data in a file so it can be quickly retrieved and processed when the bot is running.
Accomplishments that I'm proud of
I was proud that I could find the Request URL through the Dev Console that responds with the article text data. The reason I am proud of this is that I originally thought I could easily web scrape the NASA website, however, I soon realized that the source code for the NASA News website does NOT contain the article data like titles. Instead, the NASA website gets this from the Request URL I have linked above and I was proud that I could find it in the first place!
What I learned
- I learned how to work under time pressure and manage multiple tasks.
- I learned how to code slash commands in Discord.py
- I learned that the code has to be optimized in a way so that the Discord servers don't time me out.
What's next for NASA News Discord Bot
Next, I want to crowdsource ideas to make this bot more engaging and popular. I also want to host the bot on a cloud server and think about making my own API to help others get NASA News article data!
Built With
- discord.py
- natural-language-processing
- python
- web-scraping
Log in or sign up for Devpost to join the conversation.