Random Quote Generator For Campers!

Hello fellow campers. I just finished putting together a random quote generator for anyone to use in their projects. There is currently 50 quotes in the database. I put this together both for fun and as a way to give to the community. Please let me know if there is there is enough interest to keep working/expanding on this project.

Please check it out here and let me know what you think!

https://random-quote-generator.herokuapp.com/

4 Likes

You do realize there are many massive api’s out there already for this?

This is pretty cool. I know lots of campers use an API for their random quote generator and have to go searching for one. I’d stick it on github and see if you can’t also get some contributors that will either submit quotes or help write code on it!

It would be a GREAT little piece of code for someone to get their first commits under their belts!

2 Likes

Of course. There’s an API pretty much for everything. It was just a fun way for me to spend my afternoon and I thought I would share it.

2 Likes

Thanks matty22, I can certainly put it on Github and let the campers mess around with it.

1 Like

Everything in the FCC curriculum has been made thousands of times before, if not more. Does the world need another JS calculator or tic-tac-toe game? Of course not; but building and sharing things for learning and fun is why we are all here :slight_smile:

4 Likes

res.header("Access-Control-Allow-Origin", "*");

That right there is what sets this apart from every other quote API I found :slight_smile:

Of course, I think the API was a great project to do for fun, I just hoped he realized that. Thanks for sharing it @mikethecodegeek, if you put it on GitHub I would be glad to possibly contribute.

Edit: saw its on GitHub already, looking at it now. I’ll add some quotes maybe if you don’t mind.

That would be great Isaac! Thanks for the feedback

I can’t find the section of quotes anywhere on the source, how would I go about adding some more?

I used a MongoDB on Mlab. There is an API route to add more quotes.
post to https://random-quote-generator.herokuapp.com/api/quotes/newquote
the post request requires a quote and an author. The api will return the new entry as a JSON

2 Likes

If I have time I’ll try to add some, I’m busy finishing up the front-end algorithms.

I just knocked up a quick console.log() for this api - It took about 30 seconds and there where no JSONP or CORS woes!

I wish this had existed when I was doing the quote machine challenge!

Spoiler
$.getJSON('https://random-quote-generator.herokuapp.com/api/quotes/random', callback);

function callback(json) {
  console.log(json);
}

Edit

3 Likes

It’s not high on my priority list, but at some point I want to do something like this. I was really hoping for a Homsar quote generator, and wondered what it would take to do it myself.

1 Like

Thats awesome JacksonBates! Thanks for taking the time to play around with the API and give feedback as well. Very much appreciated! :slight_smile:

Hey, @mikethecodegeek nice work putting together the API. I’m was looking into doing something similar for the project and came across this list:

Might be useful for your project. It’s a pretty extensive list!

1 Like

I used this for my project. Thanks!

2 Likes

Thanks for the awesome api, mate! I’m having a hard time looking for a free api that uses https since I’d like to be able to host it on GitHub pages. Keep up the good work!

You can check it out here.
https://github.com/powlamms/quote-machine

1 Like

Thanks. Saved me two days worth of trouble. I tried quite a few APIs out there and kept getting the MIME mismatch error. This one worked perfectly. :slight_smile:

Thanks Mike, I was looking for an API to use then I saw your post top work.