Random Quote Generator For Campers!

Random Quote Generator For Campers!
0

#1

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/


FCC Random Quote Challenge API
JS for my Random Quote Machine doesn't work on CodePen
Free Quotes API over HTTPS without API keys
Is Everyone coming up with their own set of quotes?
getJSON function does not return any Data
#2

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


#3

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!


#4

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.


#5

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


#6

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:


#7

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

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


#8

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.


#9

That would be great Isaac! Thanks for the feedback


#10

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


#11

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


#12

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


#13

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


#14

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.


#15

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


#16

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!


#17

I used this for my project. Thanks!


#18

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


#19

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:


#20

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