Inspiration
We share a love for corgis. We first wanted to come up with a punny domain name and we thought of corgis. Also, Kayla used to send dog pictures when her friends were sad to cheer them up. So we wanted to make a website where people can easily get cute corgi pictures without having to scour the web.
What it does
Our website features various pictures of corgis. A phone number is provided for users to text to. We used the Twilio API to have a randomly generated picture of a corgi sent back to the user along with a cute caption. We added special keywords "beach" and "meme" to get specific corgi pictures. At the bottom of the page, a video to a corgi video compilation is also included for users that want to watch corgi videos. We also embedded @dog_rates tweets since they are paws-down the best dog Twitter account.
How we built it
For the SMS/text replies, we used the Twilio API and Python. We made a database by storing links to image addresses from Google Images as strings in lists. When the Twilio API receives a text, a random number is generated by using randint with the range being from zero to the length of the list minus one for the messages list and the pictures list according to what the body says. To ensure that the messages and pictures aren’t repeated with the following text, we used a try-except. We tried the index of the list against the temporary global variable storing previous indexes used and caught the NameError exception if the global variable has yet to be created because it’s the user’s first time texting the number. For the global variables, we created three different variables: a list variable storing the last index of the message and general pictures list and two int variable storing the last index for the beach pictures and the meme pictures. We checked which picture list to send a media from by checking if the body is equal to the meme or beach strings, not case-sensitive, and checking it against the respective global variables, else we checked it against the second index of the global list variable. We sent the messages using the functions from MessagingResponse object from the Twilio API.
The website was built with HTML & CSS along with Amazon Web Services and domain.com. We used Sublime to write the code and hosted it on Amazon Web Services.
Challenges we ran into
For the website, it was difficult hosting the code and getting it to connect to the DNS and the domain. We haven’t worked with hosting websites and connecting that with domains before, so it was difficult navigating tutorials and making sure the DNS information was correct. Our website appears on Amazon Web Services, but would not connect to the domain. We didn’t know where things went wrong, which was frustrating and took a long time. The domain that we registered is still not connected to Amazon Web Services (as of the submission deadline). For the SMS/text replies, we ran into problems trying to understand the implementation behind Flask and ngrok tunnels. In addition, we experienced many HTTP retrieval failures, which means that there was a failure attempting to retrieve the URL’s contents.
Accomplishments that we're proud of
We applied what we learned from class using APIs and third-party libraries in our project. We ran into many problems throughout the hacking period and were often frustrated that things didn’t work the way we wanted, but I’m (Karen) proud that we stuck with our plan and found a way to solve the conflicts. Additionally I’m (Kayla) really proud that I created an accessible way for my friends to receive dog pictures whenever they are in need of some. I look forward to their reaction when they learn that they can acquire dog pictures by just texting a certain number.
What we learned
We learned how to use Twilio’s API, ngrok, and Flask by implementing what we learned through the demo shown by Twilio and exploring Twilio’s and ngrok’s documentation. With ngrok, we learned how to set up HTTP POSTs and how to debug the errors that we faced. We also learned how to navigate Amazon Web Services and how to host our code on a domain.
What's next for Good Corgi
For the SMS program, we attempted to use the Google Custom Search API so that we can connect images directly from the web instead of hard coding all of the image links into the program. However, we were unable to implement the Google API so in the future we could work on that implementation so that users can have a wider search range for certain images. For the website, we would like to link or embed Facebook events such as Corgi Beach Day so that we can connect users with events to actively follow their love for corgis and see corgis personally! Also, it would be amazing if the original intended domain worked with Amazon Web Services.
Log in or sign up for Devpost to join the conversation.