Nitesh is back to blogging.. Apologies for no updates since last 2 months..
TopBottom
Showing posts with label Blogger widget. Show all posts
Showing posts with label Blogger widget. Show all posts

Recent comments widget generator for blogger

Posted by Nitesh Kothari on 17 April 2009
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Almost all the blogs in blogosphere have recent widgets. here is a simple blogger widget generator, which will generate recent comments for a blog. You can decide the no of comments to be displayed, Comment date and summary. This widget works with All the browsers.


Enter the details below.

Customize Recent Comments Widget

http://

(eg: "yourblog.blogspot.com" or "www.yourblog.com")

characters



           






Final Words

This is a simple blogger widget generator to get a customzied recent comments widget for blogger blogs. Didi this work fine with your blog? Is it working with all the browsers?

Feel free to leave a comment or feedback here.

Show current day and date on blogger - blogger widget

Posted by Nitesh Kothari on 16 December 2008
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Wolverine hacks has new magazine style look. Many readers were happy with the current date section at the top left. It is very easy to show current day and date on Blogger using Current date and dat blogger widget. Copy and paste the following code to a new HTML/Javascript box in the page element section.


<script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
var montharray=new Array("January","February","March","April","May", "June","July", "August","September","October","November","December")
document.write("<p>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</p>")
</script>
<p align="right"><font face="arial, helvetica" size="-2"><a href="http://clwolvi.blogspot.com">Grab this widget</a></font></p>

Leave a comment, if you have any problem or query.

Labels:

Display posts as headlines - blogger widget

Posted by Nitesh Kothari on 28 October 2008
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Do you like the way news channels display moving headlines? If yes, then you should check out this blogger widget called WH Headlines. This blogger hack displays recent posts as headlines. You can see live demo above this post.

How to Add WH Headlines blogger widget to your blog


Copy the following code to a new HTML/javascript gadget in layout section.

<script style="" src="http://ads.googlecode.com/files/Headlines%20widget%20.js"> </script><script style=""> var nMaxPosts = 15; var sBgColor; var nWidth; var nScrollDelay = 175; var sDirection="left"; var sOpenLinkLocation="N"; var sBulletChar="»»"; </script> <script style="" src="http://Yourblog.blogspot.com/feeds/posts/default?alt=json-in-script&amp;callback=RecentPostsScrollerv2"> </script>

How to Customize this widget/Gadget

var nMaxPosts = 15; - This code sets the no of posts in this widget.

var sBgColor; - If you want to set background color then change this code to var sBgColor= grey;

var nWidth; - Modify this code to change the width to var nWidth= 100px;

var nScrollDelay = 175; - This code is used to set the speed of scrolling. Lesser the no, higher the speed of scrolling.

var sDirection="left"; - This code sets the direction of scroll. left = Right to left; Right = Left to right; Up = Down to up; Down = Up to down

var sBulletChar="»»"; - This bullet appears before each post link in this widget. You can replace this to any other bullet.

http://Yourblog.blogspot.com - Replace this code by your Blog address.

Final Words
I am planning to write a series of posts on this hack. Comment here and tell me how did you like this hack?

Labels:

How to show 10 posts instead of 5 posts in blogger

Posted by Nitesh Kothari on 17 October 2008
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

One of the most popular and useful blogger hack or blogger widget is Recent Posts. This blogger hack lets you display recent posts of your blog. Maximum number of bloggers use blogger feed for this purpose. But, this method one limitation, i.e. only 5 most recent posts can be displayed. I had promised my readers that Wolverine Hacks will have a new look soon.While designing a new template for Wolverine Hacks, I planned to have a widget which can display 10 most recent posts.


How to show 10 recent posts

I tried to edit the blogger code to make this possible but all in vain. Thus, I used JavaScript to show more than 5 recent posts. Here is the code:

<script>
function rp(json) {
document.write('<ul>');

for (var i = 0; i < numposts; i++) {
document.write('<li>');
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;

if (i == json.feed.entry.length) break;

for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}
}

posttitle = posttitle.link(posturl);
var readmorelink = "(more)";
readmorelink = readmorelink.link(posturl);
var postdate = entry.published.$t;
var cdyear = postdate.substring(0,4);
var cdmonth = postdate.substring(5,7);
var cdday = postdate.substring(8,10);
var monthnames = new Array();
monthnames[1] = "Jan";
monthnames[2] = "Feb";
monthnames[3] = "Mar";
monthnames[4] = "Apr";
monthnames[5] = "May";
monthnames[6] = "Jun";
monthnames[7] = "Jul";
monthnames[8] = "Aug";
monthnames[9] = "Sep";
monthnames[10] = "Oct";
monthnames[11] = "Nov";
monthnames[12] = "Dec";

if ("content" in entry) {
var postcontent = entry.content.$t;
} else if ("summary" in entry) {
var postcontent = entry.summary.$t;
} else
var postcontent = "";
var re = /<\S[^>]*>/g;
postcontent = postcontent.replace(re, "");
document.write(posttitle);

if (showpostdate == true) document.write(' - ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday);

if (showpostsummary == true) {
if (postcontent.length < numchars) {
document.write(postcontent);
} else {
postcontent = postcontent.substring(0, numchars);
var quoteEnd = postcontent.lastIndexOf(" ");
postcontent = postcontent.substring(0,quoteEnd);
document.write(postcontent + '...' + readmorelink);
}
}
document.write('</li>');
}
document.write('</ul>');

}
</script>

<script>
var numposts = 10;
var showpostdate = false;
var showpostsummary = false;
var numchars = 100;
</script>

<script src="http://YOURBLOG.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp"></script>

<div class="clear"></div><p style="text-align:right;"><a href="http://feeds.feedburner.com/~r/wolverinehacks/~3/423845145/how-to-show-10-posts-instead-of-5-posts.html" title="Grab this wiget">Grab this Widget</a></p>

If you want to use this blogger hack, just copy this code to a new HTML/Javascript Gadget.

Final Words

I hope you will find it useful for your blog. Give it a try and leave your feedback or query here. What do you want me to write next?