Agustus 29, 2009

Create a Random Post

Random post is a post that is displayed randomly on our blog. Maybe my friends blogger tips all seen this one widget. Usually the bloggers gave the name of this widget is a Random Post. How to make it very easy, simply plug the code below on your blog, of course you have to login to your blogger account first.
Lets straight to the point...


1. Log into your blogger account
2. Click customizations>> added the page element> html / javascript
3. Enter the code below in the box out.
<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ul style="text-transform: capitalize;">');
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write('</ul>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=ac99ebe0691031008a48d750fdbeaa67&url=http%3A%2F%2Fanothertutorials.blogspot.com&num=10" type="text/javascript"></script>

4. Change anothertutorials.blogspot.com in this code with your blog address. And save ...

Note: The number 10 is the number of posts that will appear randomly.


1 komentar: