How to create Twitter tell a friend API

Twitter provided lot of api to share your website, here am going to show you how to create Twitter tell a friend API.

1) Create a tell a friend share action page

e.g refer-login.php

In this page you add twitter meta tag like image and content.

e.g

<meta name=”twitter:card” content=”photo” />

<meta name=”twitter:site” content=”@technomania” />

<meta name=”twitter:title” content=”To create Twitter tell a friend” />

<meta name=”twitter:description” content=”description” />

<meta name=”twitter:image” content=”image path” />

2)  Then in tell a friend page link twitter tell a friend share button to https://twitter.com/intent/tweet?text=share message&url=refer-login.php&via=sitename.  This will automatically fetch image from meta tag in refer-login.php and display in users tweet.