Build a Random Quote Machine - The Correct Way?

i used Array too.

I you want to tweet the very first quote it doesn’t work. I tried a few times.

As many have already said, as long as you fulfil the user stories its all good.
Personally I used an API. I think you will learn a lot more doing it with an API. It got very frustrating and a lot of googling was involved but I feel it was time well spent plus it gave me a lot more knowledge for the other API challenges.
All the different API’s will have their unique challenges and I wouldn’t want you to miss out on the fun :slight_smile:

2 Likes

I am too having problems with this challenge

I think my issue is with the actual lessons.
For the past set of challenges, I was able to use what I had already learned
I didn’t like the JSON and AJAX classes, I was just typing as told and not understanding properly.

While I imagine that as long as you pass the use stories it will be ok, I also imagine the idea is to use the AJAX/JSON/API skills to do this.
I am trying to find non FCC tools to learn those things so I can use them here.

2 Likes

Hello ZackWard,
Can u please share your json file, as I want to try your method for this project.

@sanjana-1604 Sure, you can find it here: https://assets.zackward.net/ron-swanson-quotes.json

One thing never mentioned about this project is the 140 character limit of Twitter. So it’s useful to add some kind of alert when you click your tweet button whenever the quote is too long. Also, your API should preferably come from an HTTPS source. For one thing, if it isn’t it won’t work in Codepen.

1 Like

Hello,

It makes much more sense to use APIs simply because of the large amount of data made available to you through them. That’s what’s so great in using APIs: you can return a large chunk of data through one simple hit. I strongly recommend you get familiar with them as they will benefit you greatly.

On the other hand, the project can surely be built with arrays, but it will somewhat be limited compared to using APIs (think of the limitation of populating/updating your array with a number of quotes).

Whichever way you choose, it is a good opportunity for you to learn how to manipulate and display data. I even recommend you trying both implementations if you have the time and patience so that you can understand the different skills at play.

Cheers and best of luck,

Hanna

It worked just fine for me when I clicked the pen here in the forum. But great job :+1:

Haha! Whyyy did you build your portfolio site like this? Please let me pause the music intuitively! I thought the pause icon in the top bar would do it, but not on my end. Then I sought out an iTunes app but couldn’t find it. :stuck_out_tongue:

I agree with the sentiment that it’s a good opportunity to use public APIs to get used to using them. But I also think with these little projects that your interest is going to be much higher if you can make it relevant to something you’re interested in – which if you can do with a public API, great!

I made one using a collection of some artist’s quotes matched with images of their work for the background, and that made the project exciting for me. Now you’ve got me rethinking it though and maybe I could do something with the SFMOMA API. :slight_smile:

Ultimately – it doesn’t matter what you do, so long as whatever you do, you do it the best you can, you enjoy doing it, and you learn something from it.

1 Like

Haha… I was just playing around. There’s a Youtube video playing in the PULP Tribute “window”. Scroll down within that window.

https://randomquote-owel.surge.sh/

Oh! I didn’t realize I could scroll in there, haha. Good stuff :+1:

I made the random quote machine initially with an api. Then I realized a lot of random quotes won’t fit tweet specifications. So when I went through a week of feeling depressed, I decided to make a random quote machine with an array of motivational quotes. Gave it more of a personal flair by using some quotes that I actually am inspired by.

I felt the second way was better even if you don’t have as much access to quotes compared to an API. There’s more personality to it.

1 Like

Had no clue what API’s were and how to use them so I did the challenge first with arrays. Spent about a month relearning jquery and html to get a better base. Along the way watched a few youtube videos and figured out what in the world these API things were and how to use them. Eventually built a nice little generator. If I have one complaint with FCC it’s how API’s were taught. Looking back on it, it’s a bit clearer but my first time it just looked like complex gibberish. Ditto for Jquery. Everything else I’m pretty pleased with.

3 Likes

Now you could challenge yourself to adjust the quote string to make it tweet-ready if someone chooses to tweet it :slight_smile:

All the quotes I put are tweet ready.

I can only think of two ways to do that: Filtering all tweets that are two long or cutting some quotes short. Which do you mean?

@wtkwon & @ayembocx I mean implement the truncateString algorithm from the Basic section to chop quotes that are too long, add a trailing ‘…’ before pushing to the tweet.

That would make quite a few quotes look awful. It’s not hard to implement that, but cutting off quotes can take away their meaning.

1 Like