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 :)

18 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.

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.

Anonymous 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

Unknown 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

Uoptutorial 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

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

Unknown 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

Web Designing Company said...


You share amazing information which makes me read your blog frequently. Keep up the good work.
thank you highly appreciated content will visit again for more information like this

feel free to visit my page for any sort of designing
CYBER DESIGN
logo design
website designing company
Branding agency
website development
SEO
Social MEdia Marketing

New Islamic Apps said...

Islamic books are available in multiple languages so everyone can read them without any difficulty. You may find the books by categories. Lists are available and they all are categorized for your convenience.

https://play.google.com/store/apps/details?id=com.dawateislami.OnlineIslamicBooks

Post a Comment