I am using the following code to show a page with a Twitter box already filled in with a message:
<a href="http://www.twitter.com/share.php?url=http://myurl.com&text=myMessage" target="_blank">Click me</a>
However, on the page, I am getting this inside the Twitter box:
myMessage/
Note the trailing slash. Any ideas how to fix this?
We have found a workaround for this, where you add the source=webclient parameter, crucially, to the END of the twitter address. When you do this, Twitter no longer adds the trailing slash. However, given how Twitter like to change their formats and codes around, there's no guarantee this will work forever :-)
For example...
<a href="https://twitter.com/intent/tweet?text=http://www.rsc.org%2FEducation%2FEiC%2Fissues%2F2013January%2F50th%2Delement%2Dtin%2Easp&source=webclient" target="_blank">Twitter this</a>
No, the solution is more simple. URL-encode your url :
https://twitter.com/intent/tweet?text=myMessage&url=http%3A%2F%2Fmyurl.com
Add a trailing slash to your URL and that should go away. It worked for me.
Change the URL from this:
http://www.twitter.com/share?url=http://myurl.com&text=myMessage
To this:
http://www.twitter.com/share?url=http://myurl.com/&text=myMessage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With