Share your url to Twitter


twitter logo

So, you’ve written that great article, you’ve shared it to your friends on facebook, and you’re looking to spread the word even further. Through Twittter, your url can reach entire diffrent audiences than Facebook sharing. Getting those first few important re-tweets on Twitter will start to spread your new blogpost like wildfire.

If Twitter is still a great mystery to you, I’d recommend Scott Hanselman’s introduction to twitter. You may also be interested in reading Twitter’s own brief “about us” page.

Time to get our hands dirty

It’s extremely simple to send an update to twitter using their public share url like so:

http://twitter.com/home?status=Currently reading https://pavsaund.wordpress.com/2009/11/04/share-your-url-to-twitter-share

So now you know how to do it, there’s no reason not to just add a tweet this icon! tweet this

Advertisements

8 thoughts on “Share your url to Twitter

  1. I tried this type of link but it´s not working – I get an error (page not found) but the page IS there, I don´t get it – it was supposed to go to twitter but looks after the page it is comming from???

    My link on top, match…

    http://twitter.com/home?status=Currently reading http://ufobilleder.blogspot.com
    http://twitter.com/home?status=Currently reading https://pavsaund.wordpress.com/2009/11/04/share-your-url-to-twitter-share

    My blog on blogger.com is set to public and anyone can see…

    It is not working..?

  2. I want to create a simple html social share widget for blog. But what you have discussed is only for manually putting link in the href. But what i want is, the current page url should be automatically submitted to the tweet. How to do that.

    1. @pravin What I’ve described here is the simplist way of sharing a url to twitter. With some basic javascript, you can capture the current page url, and update the status update call on the fly. something like this would do the trick :

      <a href="javascript: (window.location.href = 'http://twitter.com/home?status=' + encodeURIComponent('Currently reading ' + window.location.href))" >Share on twitter</a>

      I strongly recommend avoiding inline javascript, but it works fine for small features like this. Also, for more advanced features, Twitter has an well-documented API (https://dev.twitter.com/docs/api) which you may be interested in for further use.

  3. Nice Article: I have a one question.
    when i share my web pages link to twitter using location.href , the link got posted on twitter without hyperlink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s