So I’ve been flying along with the free code camp curriculum, completing the basic algorithm scripting with no issues. Then I meet the quote generator. HOW IN THE NAME OF GOD DO I EVEN START THIS?
Am I missing something here? I’ve spent around 50 hours on it so far and I’ve gotten nowhere. Surely the few snippets of lessons on JSON and Ajax can’t be it. Where did you guys go to learn more on the subject of APIs etc?
I did have to go outside the curriculum to learn more about JSON/Ajax, specifically with working on other APIs. Having said that, you don’t necessarily need to use a quote API for this project. If you want you could just create a static array of your own quotes locally, that’s what I did.
I felt that way too when I got to the Quote Generator…was flying along like butter and then wait, what?! I spent a couple days in panic mode just feeling lost, then I applied Read, Search, Ask… figured it out in Read and Search before getting to the Ask part… but I did a lot of reading and searching.
Take heart, sooo many people have felt that way at this point too and theres a load of information right here in the forums to help with a kick start in the right direction to help consider what steps you need to take and where you need to start the process of thinking to break this down.
I was determined to do mine with API because its something I want to learn…took awhile but when I finally finished, I learned a ton and was happy I stuck with it.
If you’re using jQuery, choose one of $.ajax() or $.getJSON(), then look through the requisite page in the official jQuery documentation. If you’re using native JS, look up XMLHttpRequest() on MDN.
Also read up on CORS (cross-origin resource sharing). The easiest way to avoid CORS problems is to make sure both the API you’re using and the site hosting your page (likely Codepen) use https (or they both use http, though http is now deprecated based on consensus from security experts).
It’s true you need to read fairly widely outside of fcc, but this is just a skill you’ll need to learn in order to succeed as a developer. It’s just a shame fcc doesn’t explicitly tell students “oh, by the way, you should start researching this stuff now because we haven’t taught it yet.” I think that’s what catches people out and makes them frustrated.
I’m was also in same condition for at least 3 weeks and some how I have managed to get around it. At first, we can try creating our own json file and accessing it with java script then move on to API’s. I used http://wunderground.com/ API which I think is fairly easy. I also helps in satisfying the user stories.
It’s taken me well over a month of hard work to build this Quote Generator and it’s not done yet (looks terrible on a phone). Used native JS for the AJAX. Little piece of advice; going beyond the basic requirements is a pain but worth the effort.
Funny, I had the same problem, but I solved the quote generator with an array of strings and a random index which was than printed out afte an element in the dom using Jquery. But when I arrived at the Local weather apo this took me ages to understand what I was doing.
Key is to understand Json and how to use it. Google , stackoverflow but also Quora, sitepoint and W3 have some good recources on it.
Don’t be afraid to look on youtube or elsewhere and see how other people are doing theirs or just working with API’s in general.
Some times the best approach is to give it a good try, get stuck, try some more, and then realize you’re stuck and go look for answers online. You’ll learn more with this approach than you would have if you just kept banging your head against the wall alone.