Note: Nilesh's weblog is accessible to all versions of every browser. However, this browser may not support basic Web standards, preventing the display of our site's design details. We support the mission of the Web Standards Project in the campaign encouraging Internet users to upgrade their browsers. (Read More)

Nilesh's Weblog


MTBlogTimes

November 29, 2002 10:15 AM


Inspired by Brad Chaote and Adam Kalsey's never-say-not-possible MT plugins, I came up with a wierd thought of plotting the post times of my blog in a timespan of 24 hours. And I knew it might not be impossible, even though I had never ever peeked into the MT code and plugin API. And here I am, after 3 days of poking and probing through MT plugin API and Brad and Kalsey's plugins. This goes miles to prove how very well Ben Trott has created the MT API. They are damn easy to code!

MTBlogTimes creates a chart which plots the time of your posts(in a specified period) on a bar of the 24 hours of the day. I haven't found any apparent advantage of doing so. Well, probably someone will devise a way of using this too. Say like, analysing the blog patterns for various blogs (provided everyone shared their blogtimes) .. or like finding out a true blogomaniac, a person who blogs all day... Nevertheless the resulting graphic looks cool. Check it out -

MTBlogTimes

You can download this plugin here: mtblogtimes-1.0.tar.gz or mtblogtimes-1.0.zip

Prerequisites

This plugin has been tested on MovableType v2.51 but should work on versions >= 2.2. Also, it requires the Perl GD module. I have tested the plugin using GD v1.4. You should not have any problem with newer versions.

Installation

Extract the tar-gzip or the zip file and copy the plugin to the MT plugins folder.

(mt home)/plugins/blogtimes.pl

Description

This plugin allows you to plot the time of your posts in a given period in the form of a timeline bar.

Tags made available through this plugin:

  • <MTBlogTimes>: Container tag for bar/pie creation.
  • <MTBlogTimesWidth>: Returns the width of the image. This is not the same as the width you specify in the tag attributes. This is because the bar is padded additionally for writing the text.
  • <MTBlogTimesHeight>: Returns the height of the image. This is not the same as the height you specify in the tag attributes. This is because the bar is padded additionally for writing the text.
  • <MTBlogTimesFilename>: Returns the filename of the image
  • <MTBlogTimesFullFilename>: Returns the complete path of the image
  • <MTBlogTimesFileURL>: Returns the URL created for the image.

Tag Attributes for <MTBlogTimes>

width: This allows you to specify the width of the timeline bar in pixels. This is not the final width of the image because padding will be added to this to put the text. If you do not specify this, the value defaults to 400.
height: This allows you to specify the height of the timeline bar in pixels. If you do not specify it, the value defaults to 30.
name: Allows you to specify the name of the image that will be created. The default value is `blogtimes'.
save_dir: This attribute allows you to alternatively specify a sub-directory under <MTBlogSitePath> where you can store the generated image. This directory should be write-accessible to MT or the file won't get created.
linecolor: This allows you to customise the colour of the plot lines on the bar. Specify this color in hex format e.g. #RRGGBB. The default value is #FFFFFF
textcolor: This allows you to customise the colour of the text on the bar. Specify this color in hex format e.g. #RRGGBB. The default value is #757575
fillcolor: This allows you to customise the colour of the bar background. Specify this color in hex format e.g. #RRGGBB. The default value is #757575
bordercolor: This allows you to customise the colour of the border of the image. If you want to turn off the border, simply specify the color of your page background. Specify this color in hex format e.g. #RRGGBB. The default value is #757575
padding: This allows you to control the padding around the timeline bar. The default is 5px.
show_text: This allows you to shut off the text and keep only the bar.
month: this allows you to specify the month for which to plot the timeline. You need to specify thi sin the format YYYYMM. e.g. November 2002 would be `200211'. If you do not specify this, the current month at the time of rebuilding the page is taken.

Usage

When you rebuild a page containing <MTBlogTimes> tag, an image is generated and stored on your server. You can link the image on the page or somewhere else. Please note that the generated image is a PNG image with transparency set. If you do not like transparent images, you'll need to edit the script and remove the appropriate line. Here's an example of how you can use the <MTBlogTimes> plugin -

Simple:

<MTBlogTimes>
<img src="<$MTBlogTimesFileURL$>" width="<$MTBlogTimesWidth$>" height="<$MTBlogTimesHeight$>" border="0" alt="B L O G T I M E S" title="B L O G T I M E S" /> </MTBlogTimes>
Customised:
<MTBlogTimes fillcolor="#4a4a4a" textcolor="#4a4a4a" linecolor="#FFFFFF" bordercolor="#4a4a4a" width="400" height="30" save_dir="images" show_text="on">
<a href="http://nilesh.org/mt/blogtimes/"> <img src="<$MTBlogTimesFileURL$>" width="<$MTBlogTimesWidth$>" height="<$MTBlogTimesHeight$>" border="0" alt="B L O G T I M E S" title="B L O G T I M E S" /> </a>
</MTBlogTimes>

B L O G T I M E S

Either you can paste this code directly on your page, or the cleaner way of doing it is to create a Template Module called BlogTimes and including it on the main page like this -

<$MTInclude module="BlogTimes"$>

Some cool things you can do:

* Save the timeline using the month as names - e.g. `http://nilesh.org/weblog/images/blogtimes-2002-nov.png'. You can do this by giving the filename as this -

<MTBlogTimes name="<$MTDate format="blogtimes-%Y-%b">">
<img src="<$MTBlogTimesFileURL$>" alt="B L O G T I M E S"/></a>
</MTBlogTimes>

You can later reference these images in your monthly archives.

ToDo

  1. Allow more customisation of the period which is at present limited to a month. Probably a flexible period with start date and end date.
  2. Allow a vertical timeline bar for placing on your sidebar.
  3. Add another view, say something like a piechart.
  4. If you think there is something more you can suggest, mail me.

Support

If you have any problems installing this plugin or need help for installation, post your problem to this MovableType Forum thread. Or you can put your questions / comments on this page.

Changelog

  1. 29/11/2002 - Released BlogTimes plugin.

License

This plugin is released under the MIT License.

Author

Nilesh Chaudhari (mail at nilesh.org)



Comments

44 comments have been added. Add your comments.

1. Reference from Arnab's World :: Weblog
Fellow Indiblogger Nilesh Chaudhari has created a way-cool MTBlogTimes plugin for Movable Type that allows you to create an awesome
Read more in MTBlogTimes »
on Nov 29, 06:18 PM | link to this comment


2. Reference from blog.bulknews.net
右上に MTBlogTimes プラグインをつけてみた。書き込みしてる時間が timeline で表示されてなかなか cool です。
Read more in MTBlogTimes »
on Nov 30, 02:30 PM | link to this comment


3. jeremyw said...

very cool plugin. I love how the graphic looks. vertical implementation would be nice, too. thanks. nice site, btw.

on Dec 1, 04:06 AM | link to this comment


4. Nilesh said...

Ya, I want to do that. I have it in my TODO.

on Dec 1, 06:05 AM | link to this comment


5. Reference from J : Da Blog
No shit sherlock Found that cool image (which is my graphic now) on my hard drive. Tried to edit the
Read more in I'm no graphic artist »
on Dec 1, 04:43 PM | link to this comment


6. Reference from masala
MTBlogTimes, a MT plugin by nilesh. Great work, Nilesh. Long back, I released these three plugins for nucleus. I never got around to completing another one although I have a few experimental plu...
Read more in MTBlogTimes »
on Dec 2, 10:53 AM | link to this comment


7. yosshi said...

cool plugin!
but i got a error massage as "Can't locate object method "png" via package "GD::Image" at plugins/blogtimes.pl line 131. " from MT when I'm going to rebuild INDEX template.
what should I do?
I am using dreamhost.com sharing sever.

on Dec 3, 06:27 AM | link to this comment


8. Nilesh said...

Yosshi,
can you find out the version of GD that your host has? Most probably it is an old version which does not produce PNG images. GD has since long removed GIF support because of licensing issues.

on Dec 3, 09:24 AM | link to this comment


9. Nilesh said...

There is a test script in the source tarball of Perl::GD. You can use that to check the version. i.e. if you have telnet/ssh access to your server.

on Dec 3, 09:25 AM | link to this comment


10. yosshi said...

hello, Nilesh

I asked to my host company about the version of the module. they answred like this;

> We have 1.18 installed. If you need a newer version you can probably
> either download it from the MT people and place it in your 'extlib'
> directory under your main MT install (see MT support about this).
>
> If they don't have a version available, you can compile it yourself in
> your home directory. It's for advanced users but will do exactly what you
> want.

i have no idea about compiling perl module.
i want to ask you again that there is the way to use GD function with MT's 'extlib' directory.
I really want to use the plugin, MTBlogTimes!

on Dec 3, 03:18 PM | link to this comment


11. Nilesh said...

Yosshi,

Take a look at the MTBlogtimes thread on Movabletype forum or at its homepage here ->

http://nilesh.org/mt/blogtimes/

I have posted some precompiled perl modules. i doubt whether they will work on your server, but nevertheless try them out. Extract the files in the extlib folder.

on Dec 3, 05:08 PM | link to this comment


12. Emmanuel said...

On my setup, the date based example that you give above (to save the graphics over time) does not work.

I have modified the source code so that the name parameter is passed through date format specification. In my modified implementation, you can simply have: <MTBlogTimes name="blogtimes-%Y-%m">. Do you want the code to generate a 1.1 version?

on Dec 11, 12:58 PM | link to this comment


13. Emmanuel said...

Of course, the HTML markup disappeared in my example. What I meant is name="blogtimes-%Y-%m" as a parameter to the MTBlogTimes parameter.

on Dec 11, 01:00 PM | link to this comment


14. Nilesh said...

Emmanuel, thanks for bringing that to my notice. I had written the tip expecting that I'll enable the MT tag parsing. I finished the code without it and forgot about it. You can send me the code. I'll put it out with the 1.1 version with proper credits.

on Dec 11, 04:38 PM | link to this comment


15. Amit [Netahoy] Agarwal said...

innovation at work here :) the over outlook is cool now it timme to put it to my use ;) keep pluging!!

on Dec 16, 03:58 PM | link to this comment


16. Chandler said...

Put me on the interested parties list for 1.1 as I got flumoxed by the date format thing too. Nice eye-candy btw

on Dec 21, 09:18 AM | link to this comment


17. Jason said...

Any progress on a 1.1 version to fix the name attribute, or at least a work around? I'd love to use that attribute but so far can't get it to work.

Thanks a bunch. Love the plugin. Now to just get my site totally converted to MT from my home grown code....

on Jan 22, 10:21 PM | link to this comment


18. Reference from Unix Gal
Well, I finally got around to getting this set up. I've added an image to the bottom of my main
Read more in MTBlogTimes »
on Jan 30, 10:04 AM | link to this comment


19. Reference from J : Da Blog
No shit sherlock Found that cool image (which is my graphic now) on my hard drive. Tried to edit the...
Read more in I'm no graphic artist »
on Mar 13, 08:00 AM | link to this comment


20. Rick Zhang said...

oh, sorry, it seems that this cool plugin can not work on my blog. It cannot generate the png file, and all the html codes turn out as follow:

I use the gd.pm u provide, i am sure that all the files are in the right place
The version of my mt is 2.63

on Apr 5, 11:15 PM | link to this comment


21. Reference from YABlog
Time for a really geeky article.*...
Read more in Blog Stuff »
on May 26, 07:25 AM | link to this comment


22. Lisa, Gal of Unix said...

Does it use the server timezone to determine the date? It's already switched to the June image on my site even though it's only 6:21pm here.

on Jun 1, 06:50 AM | link to this comment


23. AMK4 said...

Same here. It's already showing June, when it's not anywhere close to midnight over here. Both the server, as well as my MT installation both are running on Mountain Time. And of course, it overwrote the old file, so there's no way to get the May image back up. And was the problem with creating different images based on <$MTDate format=...$> been resolved?

on Jun 1, 08:50 AM | link to this comment


24. Nilesh said...

Does it use the server timezone to determine the date

It doesn't need to. It simply picks up the date from the database and plots on the image.

As far as the image going blank is concerned, Blogtimes behaves like any other plugin on the index page. Whenever the index page is rebuilt, either when a new post is made or when someone comments on your posts, blogtimes is executed and it generates a new image. If the month at the time of generation is June, Blogtimes will show June in the chart. You can observe the same on my index page now.

on Jun 5, 12:13 PM | link to this comment


25. AMK4 said...

Then there's something wrong, because when I did mt rebuilt end of last month, it was around 8pm mountain time, however BlogTimes rolled over to June. From reading comments on here, I'm not the only one with this problem. The server is running in Mountain time, and my MT installation is running Mountain time. So then why did BlogTimes roll over to June when it wasn't June yet?

I know MT's internals still work off of UTC (look at your activity log, and you'll see those aren't correct times, those are UTC times - at least on every MT installation I've seen they are), so maybe BlogTimes is doing the same?

on Jun 12, 09:32 AM | link to this comment


26. Nilesh said...

AMK4, you are right. I somehow managed to skip that. However, it would be a few days before I try to fix that as I am preoccupied. Any volunteers?

on Jun 12, 12:37 PM | link to this comment


27. Reference from Reflective Reality.
Just installed BlogTimes, its a funky plugin for MT that will most likely scare me into spending less time updating this site :D MTBlogTimes creates a chart which plots the time of your posts(in a specified period) on a bar...
Read more in Blogtimes »
on Aug 2, 01:22 PM | link to this comment


28. Reference from Maybe later....
Thanks to Nilesh for his natty little plugin for MovableType MTBlogTimes. I had a few problems getting this to work, which turned out to be because the GD Library on Plus.Net's servers did not support PNG files ! After changing...
Read more in MTBlogTimes addon »
on Oct 3, 04:51 AM | link to this comment


29. bwana said...

Im getting a similiar problem where the dates on the images do not match the current date. Is this still being looked into?

on Dec 15, 06:50 PM | link to this comment


30. Gareth Edwards said...

Is there any news on a fix for the name attribute to enable files to be saved each month with filenames based on the date? Aside from that small issue, great and interesting plugin idea, and looks terrific.

on Dec 27, 09:05 PM | link to this comment


31. Reference from Vlokfeest.net
I just tried to install MTBlogTimes, but the needed GD library and all it's depending libraries are such a mess to install, that i deleted all of it again. Sorry KJ. Why are there so many image manupilation libraries btw? GD, ImageMagick, NetPBM, whate...
Read more in MTBlogTimes »
on Dec 28, 06:47 AM | link to this comment


32. Reference from Vlokfeest.net
I just tried to install MTBlogTimes, but the needed GD library and all it's depending libraries are such a mess to install, that i deleted all of it again. Sorry KJ. Why are there so many image manupilation libraries btw? GD, ImageMagick, NetPBM, whate...
Read more in MTBlogTimes »
on Dec 28, 06:06 PM | link to this comment


33. Reference from Vlokfeest.net
I just tried to install MTBlogTimes, but the needed GD library and all it's depending libraries are such a mess to install, that i deleted all of it again. Sorry KJ. Why are there so many image manupilation libraries btw? GD, ImageMagick, NetPBM, whate...
Read more in MTBlogTimes »
on Dec 28, 06:07 PM | link to this comment


34. kat said...

I love the idea of the BlogTimes but I've reset the module over and over again to get the name= attribute to work and it just won't. I only get the current month and then an extra "> prior to the image.

HELP!! Please email me if you can help a sample of it would be http://www.whats-crackin.com/archives/2003_12.php

if you go back a month or forward a month it just doesn't create the image. Or am I wrong that it can do this?

on Dec 29, 03:41 AM | link to this comment


35. Reference from NEKO:MANMA
脱朝挑長朝蝶探b懲|弔眺BlogTimes腸長朝跳朕c 鼎懲b滴朝朕懲b迭...n K 暢帳懲頂ミ/腸跳長c朕朕 1gMTBlogTimes(http://nilesh.org/mt/blogtimes/)諜蝶ナ掬づ懲暢b mtblogtimes...
Read more in BlogTimes!!@lolipopapart1 »
on Feb 6, 11:37 AM | link to this comment


36. Reference from NEKO:MANMA
脱朝挑長朝蝶探b懲|弔眺BlogTimes腸長朝跳朕c 鼎懲b滴朝朕懲b迭...n K 暢帳懲頂ミ/腸跳長c 1gMTBlogTimes(http://nilesh.org/mt/blogtimes/)諜蝶ナ掬づ懲暢b mtblogtimes-1.0.tar...
Read more in BlogTimes!!@lolipopapart1 »
on Feb 7, 03:37 AM | link to this comment


37. @nak(A) said...

Hi,
I keep getting the output :
--


--
The server reports an error that says :
--
Can't load '/home/public_html/blog/extlib/GD.so' for module GD: /home/public_html/blog/extlib/GD.so: Shared object has no run-time symbol table at /usr/local/lib/perl5/5.8.1/mach/DynaLoader.pm line 229.
--
Do you have any suggestions ?

on Feb 18, 08:43 PM | link to this comment


38. brian said...

Sign me up for that 1.1 version

on Mar 6, 01:03 AM | link to this comment


39. Reference from brian saar
Nilesh's Weblog: MTBlogTimes...
Read more in MTBlogTimes test trackback »
on Mar 9, 02:36 AM | link to this comment


40. Kingsley said...

I love this. I have suggestions too: What if the image was sectioned by weeks and hotlinked to weekly archives? That would be cool, and move it beyond eye-candy to a navigational aid. I can imagine using this instead of my Monthly archive links, so people can reach directly for times when I posted more. What if the stripes where color-coded to indicate number of comments? I wouldn't make the stripes clickable (too fine a target) but a week seems like a decent enough target t select.

on Jun 7, 02:13 PM | link to this comment


41. Nilesh said...

Nice suggestion, Kingsley. You know off late, I have received mails from people suggesting to turn blogtimes into an informational and navigational aid. I am working on a brand new MT3.0 version. If you want an immediate solution on something similar to what you need, try Srijith's hack of MTBlogtimes.

on Jun 7, 02:54 PM | link to this comment


42. Kingsley said...

Oh wow, that's awesome. I think I'll wait for that. In the meantime, I think I can add an image map to the image without any hackery, since I just want to divide it into weeks: just section it into 4 quarters, create an image map template and get MT to fill in the links on a month by monthe basis. I'll tell you how it goes.

on Jun 8, 12:43 AM | link to this comment


43. Kairos said...

I've installed the Blogtimes plugin but It doesn't work I only see a little withe box (the plug in doesn't create a blogtimes.png image) I don't know how?

Is there someone the want to help me?

Thank you

on Dec 24, 01:20 AM | link to this comment


44. Andrew said...

I've intermittently created a PHP solution to the problems people are having with this plugin in MT 3.14. You can get it here.

on Jan 26, 08:29 AM | link to this comment


Your Comments
* Please do not put off-topic comments. We reserve right to delete them at our discretion. You can post anonymously. If you are unable to see your posted comment immediately, it may have been queued for moderation. So do not submit it again. HTML formatting is allowed (only a, b, i, br, p, strong, em, ul, li & blockquote are allowed). Do not put paragraph tags. They are automatically inserted.

Name


Email


Homepage


Comments (required)


Remember Me??







© 2000-2003. Nilesh Chaudhari (mail AT nilesh.org)