• I haven’t found a plugin to do this, but I assume I could somehow change the code.

    I have a list of about 100 links withing a Delicious tag. I want to have a list on my site to show a total of 20 links, randomized from this full list of 100.

    This is roughly the code I was planning to use:

    <div id="container">
    <h2>my bookmarks</h2>
    </div>
    <script type="text/javascript"
    src="http://del.icio.us/feeds/json/ALittlePieceoftheWorld?count=20"></script>
    <script type="text/javascript">
    function showImage(img){ return (function(){ img.style.display='inline'; }) }
    var ul = document.createElement('ul')
    for (var i=0, post; post = Delicious.posts[i]; i++) {
    var li = document.createElement('li')
    var a = document.createElement('a')
    a.style.marginLeft = '20px'
    var img = document.createElement('img')
    img.style.position = 'absolute'
    img.style.display = 'none'
    img.height = img.width = 16
    img.src = post.u.split('/').splice(0,3).join('/')+'/favicon.ico'
    img.onload = showImage(img);
    a.setAttribute('href', post.u)
    a.appendChild(document.createTextNode(post.d))
    li.appendChild(img)
    li.appendChild(a)
    ul.appendChild(li)
    }
    document.getElementById('container').appendChild(ul)
    </script>

    Is it possible to put some randomize info right into this?

  • The topic ‘Delicious Randomization?’ is closed to new replies.