Chingu FCC Speedrun Challenge: Random Quote Machine

Amir Fakheraldeen
Chingu FCC Speedrun
2 min readMay 9, 2017

Continuing on with the Chingu FCC Speedrun Challenge, my second project was the random quote machine. The random quote machine project is the first one in FCC’s intermediate front end projects. The idea is to build a random quote generator which displays a new quote every time a button is clicked. Additionally, it should let the user tweet a quote by clicking another button.

For this project I continued using Vue.js of course, and also used the forismatic API to get random quotes.

The main challenge with the project was bypassing CORS. It took me quite a while to figure out that I actually needed to use a format called JSONP for the the request (learned something new!) as opposed to JSON. I considered the idea of attempting to write my own JSONP request handler, but since this is a speedrun, and since I wasn’t sure it was going to work, I eventually decided to use jQuery’s `getJSON` method, which is able to handle JSONP requests. I’ll be honest, it was a shame to have to resort to using jQuery as I had written my own GET request handler, which is based on ES6 Promises, only to discover I needed something else.

Overall, I’ve had a ton of fun building this project, and I’m looking forward to build more as I go through the speedrun challenge.

Links:

Other projects built as part of the challenge:

--

--