CodeNewbie Community 🌱

Discussion on: Text Box-> Get Posted

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

The second to solve is not specific to React but is about Twitter.

I assume you actually want to post to Twitter? I don't what "posted down" is.

I'd say solve this Twitter issue without React until you know how it works and and then add React to it.

It is possible to build up a URL of parameters such that when you go to the URL, it prefills a tweet box with a message which the user can edit and then tweet.

Tweet Intent Documentation

Note you don't handle any signing in. You just give the user a link to click and they go to Twitter and tweet and then come back.

For example

https://twitter.com/intent/tweet?url=https%3A%2F%2Fmichaelcurrin.github.io%2Fbadge-generator%2F&text=Badge%20Generator%3A%20Magically%20generate%20custom%20badges%20that%20you%20can%20paste%20in%20your%20docs&hashtags=vue,github,documentation,readme,code

Makes a tweet message like this

Badge Generator: Magically generate custom badges that you can paste in your docs 
https://michaelcurrin.github.io/badge-generator/ 
#vue #github #documentation #readme #code
Enter fullscreen mode Exit fullscreen mode

And then all you have to do once you have that URL generated is put it on a button on your site that says Tweet.

e.g. this is in markdown and loads an SVG for a neat Twitter button.

Tweet

[![Tweet](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fmichaelcurrin.github.io%2Fpython-twitter-guide%2F)](#)
Enter fullscreen mode Exit fullscreen mode

Replace # with the URL created before.

Update: the jmafe5 doesn't seem to load correctly on this site but you can check here

github.com/MichaelCurrin/badge-gen...