# Random Quote Generator For Campers!

**URL:** <https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867>\
**Category:** I Built This\
**Created:** [July 25, 2016, 10:35pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867 "2016-07-25T22:35:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 25, 2016, 10:35pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/1 "2016-07-25T22:35:05Z")

</div>

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/](https://random-quote-generator.herokuapp.com/)

---

<div class="post-metadata">

**Author:** ![IsaacAbrahamson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacabrahamson/32/30882_2.png) [@IsaacAbrahamson](https://forum.freecodecamp.org/u/IsaacAbrahamson)\
**Post date:** [July 26, 2016, 1:12am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/2 "2016-07-26T01:12:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![matty22](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/matty22/32/7665_2.png) [@matty22](https://forum.freecodecamp.org/u/matty22)\
**Post date:** [July 26, 2016, 1:16am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/3 "2016-07-26T01:16:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 26, 2016, 1:25am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/4 "2016-07-26T01:25:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 26, 2016, 1:29am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/5 "2016-07-26T01:29:37Z")

</div>

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

> **[mikethecodegeek/random-quote-generator](https://github.com/mikethecodegeek/random-quote-generator)**
>
> Contribute to random-quote-generator development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![JacksonBates](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jacksonbates/32/123402_2.png) [@JacksonBates](https://forum.freecodecamp.org/u/JacksonBates)\
**Post date:** [July 26, 2016, 1:41am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/6 "2016-07-26T01:41:05Z")

</div>

> [@IsaacAbrahamson](#):
>
> You do realize there are many massive api’s out there already for this?

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 🙂

---

<div class="post-metadata">

**Author:** ![JacksonBates](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jacksonbates/32/123402_2.png) [@JacksonBates](https://forum.freecodecamp.org/u/JacksonBates)\
**Post date:** [July 26, 2016, 1:42am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/7 "2016-07-26T01:42:52Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![IsaacAbrahamson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacabrahamson/32/30882_2.png) [@IsaacAbrahamson](https://forum.freecodecamp.org/u/IsaacAbrahamson)\
**Post date:** [July 26, 2016, 2:27am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/8 "2016-07-26T02:27:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 26, 2016, 2:37am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/9 "2016-07-26T02:37:39Z")

</div>

That would be great Isaac! Thanks for the feedback

---

<div class="post-metadata">

**Author:** ![IsaacAbrahamson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacabrahamson/32/30882_2.png) [@IsaacAbrahamson](https://forum.freecodecamp.org/u/IsaacAbrahamson)\
**Post date:** [July 26, 2016, 2:38am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/10 "2016-07-26T02:38:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 26, 2016, 2:51am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/11 "2016-07-26T02:51:13Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![IsaacAbrahamson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacabrahamson/32/30882_2.png) [@IsaacAbrahamson](https://forum.freecodecamp.org/u/IsaacAbrahamson)\
**Post date:** [July 26, 2016, 3:00am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/12 "2016-07-26T03:00:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JacksonBates](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jacksonbates/32/123402_2.png) [@JacksonBates](https://forum.freecodecamp.org/u/JacksonBates)\
**Post date:** [July 26, 2016, 11:03am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/13 "2016-07-26T11:03:14Z")

</div>

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**
>
> ```auto
> $.getJSON('https://random-quote-generator.herokuapp.com/api/quotes/random', callback);
> 
> function callback(json) {
> console.log(json);
> }
> 
> ```

**Edit**

> **[vKABrY](https://codepen.io/Malgalin/full/vKABrY)**
>
> ...

---

<div class="post-metadata">

**Author:** ![AbdiViklas](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/abdiviklas/32/95315_2.png) [@AbdiViklas](https://forum.freecodecamp.org/u/AbdiViklas)\
**Post date:** [July 26, 2016, 12:29pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/14 "2016-07-26T12:29:15Z")

</div>

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](http://hrwiki.org/wiki/Homsar) quote generator, and wondered what it would take to do it myself.

---

<div class="post-metadata">

**Author:** ![mikethecodegeek](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mikethecodegeek/32/75693_2.png) [@mikethecodegeek](https://forum.freecodecamp.org/u/mikethecodegeek)\
**Post date:** [July 26, 2016, 1:28pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/15 "2016-07-26T13:28:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Monkeybike](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Monkeybike](https://forum.freecodecamp.org/u/Monkeybike)\
**Post date:** [August 9, 2016, 8:47pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/16 "2016-08-09T20:47:43Z")

</div>

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

> **[alvations/Quotables](https://github.com/alvations/Quotables)**
>
> Quotables - A Corpus of Quotes

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

---

<div class="post-metadata">

**Author:** ![sosuper](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sosuper/32/13464_2.png) [@sosuper](https://forum.freecodecamp.org/u/sosuper)\
**Post date:** [November 21, 2016, 1:43am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/17 "2016-11-21T01:43:24Z")

</div>

I used this for my project. Thanks!

> **[randomQuoteMachine](https://codepen.io/sosuper/full/NAVGXy)**
>
> ...

---

<div class="post-metadata">

**Author:** ![powlamms](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@powlamms](https://forum.freecodecamp.org/u/powlamms)\
**Post date:** [March 25, 2017, 3:49am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/18 "2017-03-25T03:49:48Z")

</div>

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](https://github.com/powlamms/quote-machine)

---

<div class="post-metadata">

**Author:** ![UnovaXan](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/unovaxan/32/162773_2.png) [@UnovaXan](https://forum.freecodecamp.org/u/UnovaXan)\
**Post date:** [April 25, 2017, 11:49am UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/19 "2017-04-25T11:49:25Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![rexhar](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rexhar/32/63808_2.png) [@rexhar](https://forum.freecodecamp.org/u/rexhar)\
**Post date:** [May 24, 2017, 3:14pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867/20 "2017-05-24T15:14:59Z")

</div>

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

[Next page](https://forum.freecodecamp.org/t/random-quote-generator-for-campers/22867.md?page=2)
