Random quote machine: what do I need to know?

I couldn’t wait to get to this task! Whenever I learned a new language (in Turbo Pascal many years ago, then perl, then Delphi), I always wrote one to run locally on my Windows machine. I wrote a Wordpress plugin too for my blog, which is the extent of javascript I knew before joining FCC. And I have an awesome collection of quotes that I’d like to use. But…

I know absolutely nothing about web programming paradigms (that’s why I’m here). I don’t think the curriculum so far has prepared me for this task. I don’t know what i don’t know. The hint to use ‘whichever libraries or APIs’ doesn’t really help, since there must be hundreds of different frameworks out there, but which one(s) are suitable for this?

So my question really is: where should I look? What do I need to know? What APIs will be helpful?

And more specifically: if I want to use my own collection of quotes, do I have to build a json server? (And should I attempt it at this point?) Or, if I wanted to use an SQLite database to hold the quotes, is there a library that will serve data out of it to an http request? (I have a shell account with Dreamhost, so I do have a place to put a db, but where do I go from there?).

Also, the Twitter button. Nothing in the course so far gives any directions on such integrations. So, the same question: what must I learn?

Thanks in advance for any pointers!

Try this playlist I made for my High School Students.

1 Like

Hello! (I would even go as far as “Cześć! To kolejne miejsce gdzie niemal od razu spotykam Polaków :D”)

I am yet to get to your level, but I figure that I could share one small insight that I got regarding programming in general: start small and don’t forget the basics.

I have found a pre-existing page that shares quotes Quotes on Design. They also have their own API and examples of use. They also link to a tutorial on the use of WordPress with their API on a CSS-Tricks site. Look at their approach, try to apply what you already know about both WordPress plugins and JS. Play around with their solution, perhaps their approach is already different to what you would do? Looking at different methods to learn and understand isn’t a sin, usually, can benefit you in the long run. They are using JSON and REST API.

I hope that even if I didn’t help you directly, I didn’t bore you with my advice/ramblings.

1 Like

OK, so it turns out json is easy (at least the basics are) and fun!

I didn’t want to use somebody else’s quotes, and I didn’t want to hard-code the quotes in javascript, since then you’d either have a small page with a boring 20 quotes, or a thousand quotes in a humongous, slow-loading page. So I took some quotes from my collection, put them in an sqlite database, wrote a bit of php and a bit of JS, and here’s what I got


(Still need to style it and add the Twitter button to finish the project.)

Unfortunately, I cannot run it off codepen, due to the dreadful “mixed content” error.

With web development I would recommend coding slowly, especially if you are just getting started, because it can get really complicated and can result you with errors it’s going to be hard to detect.
Although those errors can be detected easily with code security software, I only know one called checkmarx you can try, your choice.
Good luck anyway!