16 A "time of day image greeting" widget for your blog
August 07, 2007 /

I've created a widget which displays a different image greeting depending on the time of day: morning, day, evening or night. You can see this in action below:

Try visiting this page at a different time of day to see the other images.

This widget uses the local time of your computer to display the correct image for the time of day. Until 10am, the image will say "Good Morning", until 5pm it will be "Good Day"; until 8pm it will be "Good evening", and then finally, "Good Night".

To install this widget in your blog, you can either use the widget installer button, or copy and paste the code further down the page into an HTML/Javascript widget of your blog.

Here is the code to copy and paste into your blog if you prefer to install the widget manually (or would like to display this in a post:

<div align="center"><script src="http://kunoichi.info/bloggerbuster_templates/greeting.js" type="text/javascript"></script></div>

You can copy and paste this code intop an HTML/Javascript widget in your blog sidebar, or in the HTML editor of your post. The image displayed is 200px wide, so it should fit neatly in most sidebars.

I hope you enjoy this widget! As you may have noticed, I've been experimenting with Javascript and widget creation these past few days, and have posted some of my successful creations here. I'm actually working towards a much larger project which I'll post about closer to completion.

Please feel free to leave your comments and suggestions below.

Technorati Tags: | | | | |

Author: Amanda Kennedy

Amanda is a professional blogger and web designer living in Sheffield, United Kingdom.

In addition to curating Blogger Buster, you can find Amanda on Twitter, Facebook or add her to your circle on Google+.

Like to share?

You may also like to subscribe to Blogger Buster's RSS feed or receive free email updates of our latest posts.

16 Comments:

  1. thanx amanda for this widget.
    i use it on my blog now

    keep up the good work girl

    regards

    ReplyDelete
  2. I have always wondered How do you make that widget installer button? Because whenever I want to give someone someone the code it appears as what it is. I want to be able to share the codes. THANKS

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Hello Alex,

    In order to "share" the codes in your blog so others can use them too, you will need to "escape" the HTML code. This means that you need to substitute the symbols used in the code for the HTML codes used to display them as regular text.

    As a quick example, here is how to display the code for a link:

    This is what the link looks like in regular code

    &gt;a href="#"&gt;This is what the link looks like in "escaped" HTML code so it will display as code in the page&lt;/a&gt;

    When I use widget installers, I use the settings outlined by Blogger in this page:

    How do I create widgets for others to add to their layouts

    In order for the widget installer to work, you will need to escape the HTML code for the widget you want users to install and use this modified code inside the form for the widget.

    I will probably post about this in detail soon, so keep checking back for updates.

    In the meantime, if you want a simple way to escape the HTML code to display the code for a script in your blog, check out the HTML Parser at Blogcrowds.

    Hope this helps!

    ReplyDelete
  5. Thanks that helps allot.

    ReplyDelete
  6. This is great.... any way you could write something that we can post custom images?

    Nice job! :)

    ReplyDelete
  7. For Tina-cious.com:

    This is actually something I've been thinking about for a while now, though admittedly I was considering a random image widget where users could add the URLs of the image they would like to use.

    What would you prefer I did first: the time of day or simply a random image script?

    ReplyDelete
  8. Now see I never expected a response! :)

    I actually found some javascript code that I can tweak to get what I want -- just haven't gotten the images I want to post together yet.

    But I'd love to see if you have something easier... I'm pretty good with codes (not like you but not too bad) -- so if you come up with something easier, I'm SURE your users would love it. :)

    To answer your question -- time of day! :)

    ReplyDelete
  9. For Tina-Cious.com,

    I also had troubles finding a matching set of images for the time of day widget. One thing I had hoped to find was a time-elapse set (perhaps of a familiar landscape or landmark) which displayed the same place at different times of day.

    Flickr (Creative Commons search) is a good place to look, as is SXC.hu (Stick Exchange) for free images. I will let you know if I discover any more.

    For the widget, I'm considering an "interactive" widget creator which would allow users to link to their own images. The scripts for this would be similar for both the time of day and random images, so I may well publish these one after another. I just need to finish some other projects first :)

    ReplyDelete
  10. Hi Amanda,

    Is there a way to edit this to feed my own images at an hourly basis?

    ReplyDelete
  11. Thanks Amanda.... now we have the fastest and easy ways to great our blog reader...

    ReplyDelete
  12. hey this widget is simply great..Thank you

    ReplyDelete
  13. I am thoroughly convinced in this said post. I am currently searching for ways in which I could enhance my knowledge in this said topic you have posted here. It does help me a lot knowing that you have shared this information here freely. I love the way the people here interact and shared their opinions too. I would love to track your future posts pertaining to the said topic we are able to read.

    ReplyDelete
  14. Thanks for taking the time to discuss this, I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information

    ReplyDelete
  15. It is so cute that can wish "good morning" and "good night" to my blog readers...thank you and hope to find better and latest widget from your website...

    ReplyDelete

Great! You've decided to leave a comment! Please bear in mind that comments are often moderated and that rel="nofollow" is in use and spammy comments will be deleted. Let's have a meaningful conversation instead. Thanks for stopping by!

Browse through the Archives

All existing posts are still available to view while I'm working on the site, albeit seen in a much simpler interface. Feel free to browse through the archives to find tutorials, templates and articles to help you build a better blog:

Blog Archive

© Blogger Buster 2010 Home | About | Contact | Hire Me