Pages

Monday, June 18, 2012

Start Tips Blog: Make random post blogspot

- Blog / Add a Gadget
- Copy and paste this code

-------------------------------------------------------------------------------
<div id="random-posts"></div>
<script type="text/javascript">
function getRandomPosts(json) {
var maxEntries = 10;
var numPosts = json.feed.openSearch$totalResults.$t;
var indexPosts = new Array();
for (var i = 0; i < numPosts; ++i) {
indexPosts[i] = i;
}
indexPosts.sort(function() {return 0.5 - Math.random()});
if (maxEntries > numPosts) {
maxEntries = numPosts;
}
var container = document.getElementById('random-posts');
var ul = document.createElement('ul');
for (i = 0; i < maxEntries; ++i) {
var entry = json.feed.entry[indexPosts[i]];
var li = document.createElement('li');
var a = document.createElement('a');
a.title = entry.title.$t;
for (var j = 0; j < entry.link.length; ++j) {
if (entry.link[j].rel == 'alternate') {
a.href = entry.link[j].href;
break;
}
}
a.appendChild(document.createTextNode(entry.title.$t));
li.appendChild(a);
ul.appendChild(li);
}
container.appendChild(ul);
}
</script>
<script src="/feeds/posts/summary?alt=json-in-script&callback=getRandomPosts&max-results=999999" type="text/javascript"></script>
------------------------------------------------------------------------------- - Enjoy :)

20 comment:

Shasing19 said...

Your tips was very detailed and I appreciated it. This is a big help for me and to my friend. Thank you.


Shasing|web design philippines

BillyZergling said...

Web Design tips are fantastic Steven, but could you perhaps do a hit on web security? I feel that most of the market are daunted by shopping at large companies like ssl247.co.uk because of their limited knowledge in the field, it's leaving their sites vulnerable.

LeaMikhaela said...

The internet and market place changes so quickly that their company must be flexible and dynamic in our solutions, technology and marketing to give us the edge and leverage your businesses needs to stay ahead of your competition.

web design pittsburgh

Lava Infotech said...

Web Design
This is really interesting, You’re a very skilled blogger. I have joined your feed and stay up for in the hunt for extra of your fantastic post. Also, I have shared your website in my social networks.

Lava Infotech said...

Web Design
This is really interesting, You’re a very skilled blogger. I have joined your feed and stay up for in the hunt for extra of your fantastic post. Also, I have shared your website in my social networks.

emily jack said...

these tips will be help full for blog, content, good blog. web designing bangalore

web design Bangalore said...

a good blog. internet marketing company bangalore

Web Design Company Bangalore said...

Like what I see so now I'm following you. Look forward to checking out your web page later on.
Web Design Company Bangalore

Website development bangalore said...

Lately I have become addicted to blogs I think. I will start reading a little and before I know it half the day is gone.
Website designing bangalore

Website Design Portland said...

Great concept! I entirely concur with the perspective. I like website thanks for the great post! Website Design Portland

InnomaxMediaLLP said...

Start tips to make random posts. Useful information

Web developer

Website Design Portland said...

These tips will be help full for blog, content, good blog. Web Design Portland

juli galetti said...

Hi, guys this is first time i am visiting this blog and so happy to see such a great info here. So many things i came to know new and the way you guys describe everything here sounds amazing. Thanks for all your work will back soon for more updates.
Intuitforce

HRM 531 Week 2 said...

It’s an awesome publish in support of all the web people; I am sure that they will take advantage from it.by HRM 531 Week 6

Thiru Moorthy said...

Thanks for your valuable informations, am working in Web Design Company in Bangalore

Hems Jacson said...

Thanks for the astonishing posting! I absolutely adored every bit of it and i additionally accept you book clear-cut to investigation out fresh things in your location.
by MGT 311 Final Exam provider

Ramesh Raju said...

Thanks for your valuable informations, this is really informative for my career. Am working in Web Design Company in Chennai

andriusic said...

Im a webdesigner and I approve this!

reetu said...

thanks for coding information .. i am Web Desiging and i follow this code

Kevin Peter said...

Wow, Excellent post. This article is really very interesting and effective. I think it’s must be helpful for us. Thanks for sharing your informative. study in canada consultant in jalandhar

Post a Comment