Tweet twitter user via href

Just quick how can I tweet a user directly from the href link on my site? Example:

<a href="twitter.com/user?newtweet=">@name</a>

      

Hope you understand what I am for! Not sure if this can be done.

+3
html hyperlink twitter


source to share


4 answers


My guess is the closest you'll be using Twitter Tweet buttons unless you want to write your own backend service that you can access via HTTP GET, which in turn will need to interact with Twitter through its API.

Using the code generator above, you end up with a code that looks something like this, where you have to swap c_eliasson

which is my twist descriptor with the one you would like to use instead:



<a href="https://twitter.com/intent/tweet?screen_name=c_eliasson" class="twitter-mention-button" data-related="c_eliasson">Tweet to @c_eliasson</a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

      

I would recommend using a code generator, although it gives you additional options to customize the look and feel.

+3


source to share


when looking at twitter buttons as suggested, you can simply use



<a href="https://twitter.com/intent/tweet?screen_name=@twittername">Tweet to @twittername</a>

      

+3


source to share


    <a href="https://twitter.com/intent/tweet?screen_name=c_eliasson" class="twitter-mention-button" data-related="c_eliasson"> Tweet to @twitteralbgoom </a> <script> !function(d,s,id){ var js,fjs=d.getElementsByTagName(s)[0];

 if(!d.getElementById(id))
{ js=d.createElement(s); 
js.id=id; 
js.src="//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}
(document,"script","twitter-wjs"); </script>

      

0


source to share


<a href="https://twitter.com/intent/tweet?screen_name=c_eliasson" class="twitter-mention-button" data-related="c_eliasson">
  Tweet to @twitteralbgoom
</a>

<script>
  !function(d,s,id){
    var js,fjs=d.getElementsByTagName(s)[0];
    if(!d.getElementById(id)){
      js=d.createElement(s);
      js.id=id;
      js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>

      

-2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics