This is

theresaanna's blog

about

web application development

and other nerdy things.

Twitter Backtweets Released

Monday, July 12, 2010

I released my first ever module today! Anyone who knows me can probably guess that this is a pretty big feat for me. I'm rather pleased with myself but still anxious!

The module is Twitter Backtweets. What exists right now is the base functionality. Any nodes posted on your site within the last 48 hours are taken when cron runs and put through the Backtweets API. This gets any tweets that have been posted linking to said nodes (URL shortened links included) and posts them as comments to the appropriate node.

For better or worse, I have decided to release it as beta with a bold disclaimer that it shouldn't be used in production at the moment. I'm hoping other devs will feel inspired to give it a whirl and give some feedback! I could use a couple of experienced eyes to go through and locate any potential problems. Being new to this, I've tried to do my homework on best practices to avoid dangerous mistakes and have put this module through quite a bit of testing. However, it could CERTAINLY use some prodding from someone else!

There is quite a bit that I want to add onto it. There's a short list on the project page so that people can get a feel for where its going. Below is an expanded list. If you have any thoughts or suggestions please let me know.

  • Instead of having to wait for cron to run, I want to put a checkbox on each node page that allows content administrators to manually get new tweets for that node.
  • Add an admin field for site admins to specify the length of time that nodes have before they expire from being checked for tweets. The default may still be 48 hours but it seems like it would depend a lot on the site's content whether that would be too frequent or infrequent. The only caviat is that Backtweets only allows 1000 requests daily.
  • There is no sense in having retweets input as comments. Filtering them out is one of the client requirements on the project that was the impetus to write this module, so these should be filtered out in comments.
  • It does make sense, though, to give a block that will list all tweets pulled in. Perhaps a master list and also display related tweets on the node view?
  • One thing that worries me is that currently, when the module is uninstalled, all of the data stays. I want to be able to give users the option to delete all related data on uninstall but not force them into it in case they would like to keep the tweets. Frankly I'm not sure how that would work.
  • Add a class on comments generated from tweets so that they can be styled differently.
  • Currently, the subject of the comment is "Tweet from @username". I'd like to stop relying on the subject line to display the username and instead display it on its own. Perhaps there is a way to do some interesting Twitter module/user integration here?