Twitter Stuff 0.3

01/16/2009

happy downloading!

It's been literally minutes in the making, but it's here. Now with lovely added templates, to save you lazy people even more leg work, you can do things like: <!--more--> {twitter:jaspertandy:avatar_link}

and get jaspertandy, and

{twitter:jaspertandy:username_link}

and get jaspertandy. Awesome, huh? I've also added the ability to force re-caching. If someone updates their avatar before your cache refreshes (this will probably only happen with people upgrading, but still!), then you'll get a dead image link or an error. If you append :force to your tag, their data will be re-cached and their avatar updated:

{twitter:jaspertandy:avatar_link:force}

Becomes jaspertandy. Only use :force if you get broken images, though, as it unnecessarily bullies twitter's api.

I have also made it easy for you to create your own templates by adding a function with the incredibly convoluted prefix; template, so your personal functions might look something like: public function templatejasperrocks($userjson){ return 'jasper rocks!'; }

Obviously, if you don't do any scripting then stay away from this or you'll break stuff. If you do, then make sure your function returns a string to replace the tag and you're good to go.

As before, if you break it then come crying to the comments box. If you don't know any PHP, but would still like a custom template, hit up the comments box and if you find this useful, say so. It's nice to hear from people!

Installation is the same as before, so once you've downloaded this, either copy your old config stuff or follow the original post. I'll do an interface so you don't have to keep doing this, if it becomes apparent that more than two people are using the plugin!