Random Quote Generator - Directly Linkable Quotes a challenge

Hey Guys,

How do I make a direct link to each quote. Looking up PWA info and I’m struggling to wade through the info for this one capability. FYI. Any assistance needs to come in the form of pure vanilla JS es6 or lower; no jQuery or other frameworks are or will be used.

Full monty situation:
One of the advanced optional asks for the Random Quote Generator is to make the site shareable, but I think in this day and age that’s not really useful, because people expect a share of a specific quote to include a direct link to that quote. Let’s be honest this expectation is compounded by the fact that the machine is random by design.

So my issue is that I have my buttons all ready to go, the share code is in place and I’m using template strings to load the precise quote info for social media sites, but I know they will now click and come back to a random quote rather than a specific url loading that quote.

HOW do I make it so they can come back to the same quote? Also I’m totally open to good sources to read that directly relate to this issue.

**NO I won’t upload my code or codepen, not because of any embarrassment or other issue, but because I want generic answers e.g. links to good sources or solid general explanations or even your own examples. I really NEED to reason through your feedback and find my own path using your insight into how you’ve addressed the problem otherwise I’m just getting answers (I feel) which I know we can all appreciate doesn’t lead to a learning experience for everyone of which I’m in the camp that needs to struggle and battle through on his own to learn. **

Please and thank you!!! :slight_smile:
tags: pwa, dynamic linking, deep links

Where are you reading this?

This is not actually what the user story says, but it’s an interesting problem to learn from. Shareable links will have relevant state stored in query parameters. For instance,


The query parameter q how Google’s servers know what you want to search for. Because this information is in the URL, you can share it easily, as I have just done. This is something you can do in the browser as well. What information you store and how you use it will depend on how your project is structured and how you are getting your quotes.

1 Like

I appreciate your pointing me in a direction; that’s helpful! :slight_smile: