Random Word

View Source Code

About this Project

Random was my first attemp at working with angular. I love words, so I thougt of a simple way to learn some more words, while building something to do that. This project quickly became a little bit more complicated than I had originally intended it to be, which in turn changed the outcome of it. But, although still glitchy (which is why its not live yet), I am excited that I was able to make the project run, while hitting two different API’s for the output.

Challenges

When I started this project, I thought, apart from the angular portion, this really should not be so difficult. I really should not have any assumptions, because although in theory this seemed simple, I hit roadblocks I had no idea existed yet. Getting the random word from the Wordnik API was fairly simple. Turned it into JSON and set it as a variable for the next query. This is where the problem came in. The Merriam Webster API is kinda hard to work through. It has all the information that you need, but its messy and getting the definition is not always in the same format. I worked through thise by running the definition through a function that cleaned it up, but it was still messy. My second problem, the one I’m still working on, is that the words that are returned by the Wordnik API are not all real words, at least not by Merria Webster’s terms. Meaning that sometimes, I just get back an emply object, which is so user unfriendly. I’ve tried a few things to solve, like only haveing words appear if they return data instead of an empty array, but that crashed the app. I’ve also tried an if/else statement, but that does not seem to work either. I know there is a solution, once I have it, I’ll feel good about uploading the app. Now for some good, I was able to get angular to run the app, it was hard, and I don’t even think I remember all of it, but I was especially happy to get the sound working. The dictionary API has a sound function, and through a few trial and error phases, the sound works.

Final Thoughts

I’m not done with this, so these will change, but what I learned from this experience is that sometimes all the planning in the world will only get you so far. I had to be open to reworking and rethinking how I was going to approach the dictionary API. I hope to get this running soon!

Resources