Showing posts with label javaScripts. Show all posts
Showing posts with label javaScripts. Show all posts

July 10, 2012

0

Random Posts Widget For Blogger

  • July 10, 2012
  • Don ZikkO

  • Random Posts Widget For Blogger i.e each time the page of your blog refreshes the posts on the blog showed by this widget changes, means this widgets always shows unique posts from your blog with unique combinations at random,i.e the widget selects the posts randomly from all your blog posts and never knows which post might it pick from your blog to show.Really this is the gem of the widget you really should show on your blog for sure.

    As before this i had blogged about a one more random posts widget in which a link was made and clicking on it would show random post in blog.



    Now how to add this widget in the blog.

    1. Log into Blogger >> Layout >> Html/Javascript .
    2.Then paste this code in it.


    <script type="text/javascript">
    var randarray = new Array();var l=0;var flag;
    var numofpost=6;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('</ul>');}
    </script>
    <script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>


    Change the the text no in red above in codes to select how many random posts you want to display.

    And Save the Widget.Now you will be shown up the the title of the posts in widget like you see in recent posts, recent comments or popular posts widget and all the posts will be picked randomly.

    Now How to show random posts title with post summary.

    Just open this script or download this Random Post Script.

    Either host it to your server or use this script only.

    You can get Free File Host Here.

    1. Log into Blogger >> Layout >> Html/Javascript .
    2.Then paste this code in it.

    <script type="text/javascript">
    var randarray = new Array();var l=0;var flag;
    var numofpost=5;var wordnumber=5;</script>
    <script style="text/javascript" src="http://btemplatescripts.googlecode.com/files/random-posts-with-summary.js">
    </script>
    <script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>


    Just change the green url with your script url which you uploaded to your server,if you want.

    Alter the codes in red in above codes to adjust the count of posts and and how much word summary you want up to show up in the widget.Thats it so Simple.If you have any problems leave your comments below.
    Credits for widget to Bloggodown.
    Read more
    5

    Where to Upload (.js) Files Free-Javascript Files Hosting Sites List

  • Don ZikkO



  • Where to upload the .js files or javascript files so as can be used by us for running it succesfully without bandwidth problems.As i post many hacks and tricks with the usage of .js files,i was having many accounts on googlepages and geocities and use to share that bandwidth and storage with my readers but after the upcoming news that both the google and yahoo have decided to close there services of googlepages and geocities, its been difficult for me to find an good server to with enough bandwidth and share with our readers.

    So i am asking my readers now to upload these files to there own server as mine will not be working because of bandwidth problems.But many of them dont know where to upload these .js files,so i have started a list of sites to share where these .js files can be uploaded and used but these sites have limited bandwidth but its sufficient for single blog user.So you can join these below sites and use there hosting services,if it dont full fill your requirement just upload your files to different servers below to distribute the bandwidth.

    Here Goes The List :-

    1)Sigmirror:-It provides 5Gb Webspace and 7Gb Bandwidth/month

    2)Hotlinkfiles:-It provides 1Gb Webspace and 4Gb Bandwidth/month.

    3)Ripway:-It provides only 30Mb Webspace and 150Mb Bandwidth/day or 4.5Gb/month.

    4)Boxstr:-It provides 5Gb Webspace and 1Gb Bandwidth/daily.Just upload your file and get the direct link to make it work.

    5)Fileave:-It provides 30Mb Webspace and 1Gb Bandwidth.You can prefer to use it only for some of your file with usage of 1Gb bandwidth.

    6)Mydatanest:-It provides 2Gb Webspace and 20Gb Bandwidth/month.You can prefer to use it for most of your file as bandwidth is much more than above sites.

    7)Getdropbox:-It provides 2Gb Webspace and Bandwidth is unknown To me.

    8)Yourjavascript:-New Provider as no need of account just host any script and get its link.

    I got only these sites but they are very less i would like to get more sites listed here so if you are using or knowing any other site to host .js files please leave them in comments i will update the list.
    Read more