Inspiration
On July 4th, a horrific mass shooting occurred in Highland Park, IL, less than 3 miles away from one of our homes, leaving the community in an indescribable amount of pain. Different people had different ways of taking care of their mental health in response. While many community members wanted to talk about the shooting constantly, and there were many forums and opportunities for these conversations to take place, others, including ourselves, struggled to read and think about such a traumatic event. Yet, because one link leads to another on today's internet, reading about this tragedy felt unavoidable.
What it does
The Trigger Warner prompts the user to enter a URL and trigger words/phrases. It then searches the corresponding HTML code and informs the user of the number of times each trigger word/phrase appears. It also gives the user the option to crawl the web which informs the user how many times the word/phrase was found after searching a given number of external links.
How we built it
We coded the Trigger Warner in Python and used the Python Turtle library to include graphics. We used Replit to collaborate and work in the same file simultaneously.
Challenges we ran into
It took us a while to figure out how to extract links and efficiently crawl from one source to another. We first tried using a method from the Python Beautiful Soup library to extract links from HTML a-tags, but discovered that this method extracted much more than URLs. This issue crashed our program at first and then greatly slowed down the runtime. Eventually, we were able to solve this problem using regular expressions to check for the start of a URL.
Accomplishments that we're proud of
Despite having limited knowledge of front-end programming languages, we were able to create visuals and are proud of the improvement we made to the user experience.
What we learned
We learned how to use the Python Turtle Graphics and Beautiful Soup libraries as well as some of their limitations.
What's next for Trigger Warner
Although we are proud of the visual aspect of our project, we recognize that the Python Turtle library has many limitations. For example, we were unable to allow for pasting into the input box and had to use a fixed screen size. Next, we hope to improve our program by moving away from Python Turtle to further improve the user interface. Additionally, because the Trigger Warner uses HTML code, it finds trigger words in elements the user does not see such as links. Moving forward we hope to be able to filter out these instances.
Built With
- python
- replit
Log in or sign up for Devpost to join the conversation.