Archive | April, 2008

ExpressionEngine plugin - Send Tweet

18 Apr08

This week, I wanted to find an easy way to maintain a Twitter channel for Flashmagazine. By following this Twitter user, you can stay up to date on current Community News, Reviews and Tutorials and get notified the instant something interesting happens.

I just love the ease of ExpressionEngine. Since I only could find EE plugins that can read from Twitter, I figured I’d make a plugin that can send messages as well. After some thinking, I made/setup/tested/implemented one in just 4 hours. I’m by no means a whiz with PHP, but making EE plugins is really easy and well documented.

I’ve tested the plugin for a couple days and it appears to work well, so I guess it’s time to release it for others to use.

About the plugin

This plugin will send messages to your account. I originally made this to set up an automated Twitter feed for my site Flashmagazine. Just seconds after I publish a new story, my subscribers can be notified of it. You could use this for a lot of other purposes as well, so feel free to email me with other use cases :)

The plugin receives a string of text and send it to Twitter. To prevent this from happening the script will write the text string to a file. Before sending another Tweet, the script will check against the contents of the text file on the server. This is a little “expensive” but should only be a performance hit on huge sites.


You will need to do some manual editing of this PHP file for this to work:

- Open the plugin PHP file in your favorite PHP editor
- Change the username and password variables at the top of the class to match your credentials
- Copy the file to your ExpressionEngine plugin folder
- Open the plugin settings in the EE Control Panel to look up syntax and check that the script installed properly

That’s all. The plugin works as a tag pair:

{exp:send_tweet}Text to send to twitter{/exp:send_tweet}

Usage Send_Tweet plugin for EE

To use the plugin to notify Twitter of new stories, paste this into your RSS template:

{exp:send_tweet}{exp:weblog:entries weblog="news" limit="1" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}{title}: {comment_url_title_auto_path}{/exp:weblog:entries}{/exp:send_tweet}

This code will send the title and URL from the latest story published to Twitter. If the URL is long, Twitter will use to shorten it for you. Keep in mind that Twitter won’t accept messages over 140 characters so keep the titles short to make sure the URL’s are not cut off.

Make sure you set the weblog parameter to reflect how you set up your site and that {comment_url_title_auto_path} works with your setup (You may need to use a different tag such as title_url, just check what is used in your RSS file). You can put this code anywhere in the RSS file. I have mine at the top of the PHP file.

How to make Twitter update automatically

Feedburner is a service that will grab and republish your RSS file. They offer a service that you can “Ping” when you have updated your site. They will then go grab the latest version of your RSS feed and re-publish it.

ExpressionEngine can “ping” FeedBurner automatically. All you need to do is to set up an account with FeedBurner and open the EE Control Panel. Go to Admin -> Weblog Administration -> Default Ping Servers and add the URL

(Note: you may use any other XML-RPC service. Feedburner is just a suggestion from me. is another good service that’ll do the same, but for a bunch of sites at once)


To see debug output from the plugin, edit the plugin file (as noted in the comments) and wrap the output with an empty node like this:

{exp:send_tweet}{exp:weblog:entries weblog=“news” limit=“1” rdf=“off” dynamic_start=“on” disable=“member_data|trackbacks”}{title}: {comment_url_title_auto_path}{/exp:weblog:entries}{/exp:send_tweet}

If you don’t add that extra node, Firefox (and maybe other browsers as well) will request the document twice, causing incorrect debug messages to be shown in some cases.

Installing plugins in EE

Download and unzip this file and copy “pi.send_tweet.php” to your plugins folder (/sysfolder/plugins/). That’s it :)

Macromedia and Adobe - newly combined?

11 Apr08

I had to reinstall my CS3 package today and got a surprise when I logged in to retrieve my serial number. On the page listing your registrations it says “We’re making improvements to support the newly combined Macromedia and Adobe community”. Wow? What can I say? Two years in the making and you still can’t view the serial numbers of your licensed products.

I sure hope this only temporarily, or the Adobe customers will have to pay the bill in the form of foolish costs to call centers that just tell people what their serial numbers are. There’s also a link to your Adobe registered products that is “Temporarily Unavailable”. Good thing I’m not in a hurry then, after all I just make a living from Adobe tools… Luckily there’s warez sites with serial numbers around, so you at least have a chance to run your software ;-P

Oh - and did I mention why I had to reinstall the entire CS3 package? Since I was part of the Dreamweaver Beta and I forgot to uninstall the software before it expired, I had to delete it manually by searching for files (The uninstaller would not start since it was expired too…). This in turn prevented it to be installed when I got my CS3 package. Not having Dreamweaver isn’t such a big deal any more. I much prefer FireBug and TextMate, but Dreamweaver wasn’t the only bit that didn’t install.

The Dreamweaver Beta also installed Device Central and Bridge and the CS3 installer was unable to remove these as well. Another problem I’ve had recently is that my Photoshop CS3 crashed upon every Open or Save attempt. The last drop was that I needed Device Central yesterday and it claimed my product was expired, so I bit the sour apple and spent an hour deactivating, uninstalling and reinstalling it all. Amazing how much stuff the uninstallers actually leave behind.

Updated: Photoshop and Dreamweaver now works, but Device Central just says “License Expired”. It appears to be impossible to reinstall just this one bit. Any suggestions welcome!

Update 2: The CS3 cleanup script did the trick when used on level 2. Blahhh… what a day to spend a day :(

Here’s something to cheer up anyone with similar problems: Elijah Wood gets mortified.

Portfolio and update

02 Apr08

Lille.jpgAbout two years ago, I quit my own company to go freelance. I was working on a huge project with more than 50 small Flash apps, but I left the project some months ago more or less out of frustration. It’s now more than three years since it was started and there’s still nothing I can show publicly.

Well, I’ve not been sitting idle. I’ve made a kids game (with Netron)  that has gotten rave reviews. The game was done in both Norwegian and English and it will soon get worldwide distribution in even more languages. With a fun storyline, more than 40 minutes of animation, 30 mini-games and a drawing program it’s a solid package of kids entertainment. The game targets kids 3-10 but should work well for childish grownups as well.


I’ve also done an awesome looking 3D map for an amusement park (also with Netron) as well as changing the backend of Flashmagazine to ExpressionEngine. I’ve also been working on an AS3 version of an Open Source project that I’ll get out the door soon. It’s lagged behind because of fun commercial work, but I’ll get it out within the end of next week.


Various Architects

I’ve also gotten myself an office downtown Oslo, in Storgata 51, straight in between the town centre and Grunerløkka. I share offices with two product designers that has a really cool device, one designer as well as three architects.

The architects website was designed by Junebug and I converted the design to ExpressionEngine and set it up. I’m yet again amazed at how flexible EE is. Every item written on the site can be associated with an architect and/or a project. If you look at an architects page, you can also see all the latest news for the projects they work on. Every project page also shows the news associated with it, so it’s effectively a full project history. Every project has a unique RSS feed so anyone can easily track the progress in a project with next to no extra effort for the one filling in the content in the CMS. Really pleased with how the site tuned out.