This is my Random Quote Generator, I passed the tests but I can’t get to tweet the content of the quote and author.
Has anyone had any luck with this?
Any other feedback is welcome!
This is my Random Quote Generator, I passed the tests but I can’t get to tweet the content of the quote and author.
Has anyone had any luck with this?
Any other feedback is welcome!
Hi @xiomara.masmela , in the href you you have to put also a parameter for the text you want to tweet. Like this:
href = "https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text="+encodeURIComponent(stringVariable)
The ? in the url says that what comes after it is a list of parameter for the http GET (I suppose) request.
Those parameters are divided by the character & and are all pairs of variable name - value.
The first parameter is “hashtags”, the second is “related”, the third is “text”.
For the value of text you’ll probably need to use the method encodeURIComponent to transform some characters of the string in something that can go in a URI (most certainly the spaces).