Monday, May 30, 2011
How does it works? It uses a code called "math.random()" which reads random posts from your XML feed. I've set it to 5 , but you can modify it later.
How to use? Simply go to your blogger account , select Design , and add a new Gadget to your template. Select Javascript/Html , and position it wherever you want the Random Posts to appear.
How to use? Simply go to your blogger account , select Design , and add a new Gadget to your template. Select Javascript/Html , and position it wherever you want the Random Posts to appear.
<script type="text/javascript">Have fun!
var randarray = new Array();var l=0;var flag;
var numofpost=5;function randomposts(json){
var total = parseInt(json.feed.openSearch$totalResults.$t,10);
for(i=0;i < numofpost;){flag=0;randarray.length=numofpost;l=Math.floor(Math.random()*total);for(j in randarray){if(l==randarray[j]){ flag=1;}}
if(flag==0&&l!=0){randarray[i++]=l;}}document.write(‘<ul>’);
for(n in randarray){ var p=randarray[n];var entry=json.feed.entry[p-1];
for(k=0; k < entry.link.length; k++){if(entry.link[k].rel==’alternate’){var item = "<li>" + "<a href=" + entry.link[k].href + ">" + entry.title.$t + "</a> </li>";
document.write(item);}}
}
document.write(‘<li><a href="http://dreamon.tk" target="_blank">Random posts</a></li>’);document.write(‘</ul>’);}
</script>
<script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>
Subscribe to:
Post Comments (Atom)
Blog Archive
-
2011
(50)
- June(2)
-
May(29)
- 5 best malware/spyware removal tools
- 5 best free antivirus software
- Random Posts widget for Blogger blogs.
- CSS Rounded Corners Generator XHTML
- 5 more Adsense-like advertisers.
- 4 AWESOME online photo editors manipulators
- Fedora 15 , a distribution that is up to date!
- Firefox 4 , the power unleashed x 2
- Audio alerts on your blog , or audio welcome messa...
- TagXedo , free online STUNNING Tag Clouds generator.
- Create your own WordPress themes ... ONLINE!
- Cutting out trees ... is super cool!
- A classic way to get a woman : Tatoos
- Great News!
- New blogger features.
- The truth about WordPress
- How to Get the perfect Free hosting for you
- How to bypass surveys on locked sites
- How to change hosts file in Vista / Windows 7
- Cool Passwords ... THAT SHOULD NEVER BE USED!
- Google Images Java Trick
- How to stop adds on web pages or any other applica...
- And thus human kind fails again. (Threatening ours...
- Another cool free webhosting.
- Video to mp3 script.
- Survey is the mainstream! (About Surveyed sites)
- Tons of free animated avatars.
- Free FTP client at its best.
- Can't find movies and movie names?
- April(2)
- March(10)
- February(5)
- January(2)
- 2010 (53)
Blog Archive
-
▼
2011
(50)
-
▼
May
(29)
- 5 best malware/spyware removal tools
- 5 best free antivirus software
- Random Posts widget for Blogger blogs.
- CSS Rounded Corners Generator XHTML
- 5 more Adsense-like advertisers.
- 4 AWESOME online photo editors manipulators
- Fedora 15 , a distribution that is up to date!
- Firefox 4 , the power unleashed x 2
- Audio alerts on your blog , or audio welcome messa...
- TagXedo , free online STUNNING Tag Clouds generator.
- Create your own WordPress themes ... ONLINE!
- Cutting out trees ... is super cool!
- A classic way to get a woman : Tatoos
- Great News!
- New blogger features.
- The truth about WordPress
- How to Get the perfect Free hosting for you
- How to bypass surveys on locked sites
- How to change hosts file in Vista / Windows 7
- Cool Passwords ... THAT SHOULD NEVER BE USED!
- Google Images Java Trick
- How to stop adds on web pages or any other applica...
- And thus human kind fails again. (Threatening ours...
- Another cool free webhosting.
- Video to mp3 script.
- Survey is the mainstream! (About Surveyed sites)
- Tons of free animated avatars.
- Free FTP client at its best.
- Can't find movies and movie names?
-
▼
May
(29)
0 comments:
Post a Comment