Add Reply, Retweet and Favourite Buttons To Custom PHP Twitter Feed
Something we do quite often on sites is add a Twitter feed to a client site displaying the latest tweets made by that company. Depending on the platform we might do this using a plugin, or create a bespoke PHP script to obtain the tweets.
When doing a Twitter feed integration recently we were asked to add Reply, Retweet and Favourite buttons to each tweet. I hadn’t done this before and it became apparent there wasn’t much written on the web about how to do this with a PHP integration.
After a while searching I finally managed to work out the URL for each link so wanted to collate them in one place and share them for others to benefit from. They are as follows:
<a href="https://twitter.com/intent/tweet/?in_reply_to=TWEET_ID_HERE" target="_blank">Reply</a> <a href="https://twitter.com/intent/retweet?tweet_id=TWEET_ID_HERE" target="_blank">Retweet</a> <a href="https://twitter.com/intent/favorite?tweet_id=TWEET_ID_HERE" target="_blank">Favourite</a>