Hi all, I am working on the Random Quote Generator and have got most of it the way I want it – except I can’t make the Twitter API work. It successfully opens a post-to-Twitter window, but the tweet is not pre-populated with the current quote.
I followed the instructions here (https://dev.twitter.com/web/tweet-button) (under “How to add a Tweet button to your website”) and took the advice of another camper who suggested using
encodeURIComponent to make the URL work. That’s where I’m currently stuck at.
Tangentially related issue: I don’t like the automatic styling of the Twitter button, and would prefer to make it match the “get new quote” button instead. Can anyone advise me on how to override default Twitter button styling?
My CodePen is here: https://codepen.io/chiseld/pen/dRzwMN
But for some reason the quote generator doesn’t seem to be working there, so I would suggest looking at it on GitHub instead: https://github.com/ChiselD/random-quote-generator
…by using the HTML preview trick: