Add Reply, Retweet and Favourite Buttons To Custom PHP Twitter Feed

June 1st, 2016 - Posted by Steve Marks to (X)HTML / CSS, PHP, Web Development.

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>
This entry was posted on Wednesday, June 1st, 2016 at 2:57 pm by +Steve Marks and is filed under (X)HTML / CSS, PHP, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.
Comments...

Fear not, we won't publish this

Comments (0)

No comments have been left yet. Be the first