Jan

12

WordPress tweetbacking

15 years ago, mid-January | 4 Comments

Tweetbacking, it sounds like some sort of deviant sport or something but isn’t. The idea behind Tweetbacks, similar to pingbacks, is that you can see who is commenting (tweeting) about your blog on Twitter. There are a number of plugins available for use in the end I went for Joost de Valk‘s version. While it worked nicely I decided that I really wanted to approve the tweets before they appeared in my blog so I modified the code a little. The diff is available for download. It allows you to enable and disable the automatic approval of Tweets form the plugin’s admin page. Hopefully Joost will add this option in the official version sometime.

Tweetbacks are saved in the comments table and can be displayed however you like for example, in my comment loop I have:

 
<?php 
if (strtolower($comment->comment_type) == 'tweetback') {
   $avatarurl = str_replace(
       "twitter:",
       "http://s3.amazonaws.com/twitter_production/profile_images/",
       $comment->comment_author_email
       );
       echo "<img align=middle"
              ." src='$avatarurl' border=none"
              ." width=40 height=40 alt=''>";
}
?>

A word or two of caution about the plugin. Personally I’ve removed the bit.ly url shortening link parsing because it just didn’t work properly – I ended up with bogus tweetbacks until I did. The other issue is with the date saving from the tweetback, it doesn’t work properly either giving dates in the 1970’s!!!



[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tagged with:
January 12, 2009 22:09


Comments

Name (required)

Email (required)

Website

Speak your mind

4 Comments so far

  1. phillprice (Phill Price) via twitter

    @mlanger http://tinyurl.com/9zhga2 will be of interest to you until it’s part of the main version

  2. jdevalk (Joost de Valk) via twitter

    Gawd I love open source: http://tinyurl.com/9zhga2 great addition to my tweetbacks plugin.

  3. Joost De Valk on January 12, 2009 22:14

    Hmm that’s a pretty cool addition, I’ll certainly think about adding it!!

  4. ScaredyCat / Andy Powell on January 12, 2009 22:20

    Thanks, glad you like the idea 🙂 The patch should apply fairly cleanly to your current version.

Current Electricity Use (15min)


iPhone/Webkit RSS Reader

Links


Tags

1-Wire android api Apple arduino currentcost DDAR development DVD FIC freerunner G1 google Google Phone gphone gprs GPS hardware image image builds inspiration iphone jailbreak kiosk linux Mac monitoring Music neo 1973 Nokia openmoko opensource OSX Pachube personal qtopia rhubarb rikki Rio slimp3 slimserver software tracking Trolltech u-boot


Twitpic


Graphy Stuff






Nasty Spam Monkeys