Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 252 lines (242 sloc) 7.77 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="description" content="The jQuery Lifestream plug-in enables you to show a stream of your online activity. On this page you can check out an example">
  <meta name="keywords" content="jQuery, plugin, lifestream, jquery-lifestream, twitter, delicious, github, stackoverflow, flickr, lastfm, youtube">

  <title>jQuery Lifestream example</title>

  <style type="text/css">
    body {
      margin: 1.0em;
      background-color: #fff;
      font-family: Helvetica, Arial, FreeSans, sans-serif;
      color: #000000;
    }
    h1 { font-size: 3.8em; color: #3908bc; margin-bottom: 3px; }
    h1 .small { font-size: 0.4em; }
    h1 a { text-decoration: none }
    h2 { font-size: 1.5em; color: #3908bc; clear: both;}
    h3 { text-align: center; color: #3908bc; }
    a { color: #3908bc; }
    ul li { list-style-type: none;}

    #lifestream {
      background: #333;
      border-radius: 7px;
      color: #d4d4d4;
      width: 450px;
      font-size:11px;
    }
    #lifestream a {
      color: #f6dd97;
      text-decoration: none;
    }
    #lifestream a:hover {
      color: #fff5d8;
      text-decoration: underline;
    }
    #lifestream ul {
      padding: 10px;
    }
    #lifestream li {
      padding: 5px 3px 5px 25px;
      background-repeat: no-repeat;
      background-position: left center;
    }
    #lifestream li:hover {
      color: #e9e9e9;
    }
    #lifestream .timeago {
      opacity: .5;
    }
  </style>
  <link href="css/lifestream.css" rel="stylesheet" type="text/css">
  <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
  <a href="http://github.com/christianv/jquery-lifestream">
    <img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
  </a>
  <h1>jQuery Lifestream Example</h1>
  <p>Find more information about this plug-in on the <a href="http://github.com/christianv/jquery-lifestream">project page</a>.</p>
  <p>Go ahead and <a href="http://christianv.github.com/jquery-lifestream/me/">create your own lifestream</a>.</p>

  <h2>Lifestream - formatted with CSS</h2>
  <div id="lifestream">&nbsp;</div>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
  <script>!window.jQuery && document.write('<script src="http://code.jquery.com/jquery-1.6.1.min.js"><\/script>');</script>
  <script src="jquery.lifestream.js" type="text/javascript" charset="utf-8"></script>
  <script src="https://raw.github.com/rmm5t/jquery-timeago/master/jquery.timeago.js" type="text/javascript" charset="utf-8"></script>
  <script>
    (function(){
      var count = 0,
      list = [
        {
          service: 'blogger',
          user: 'googleblog'
        },
        {
          service: 'dailymotion',
          user: 'VideojugTechnologyandCars'
        },
        {
          service: 'delicious',
          user: 'denbuzze'
        },
        // If you want to fetch your main gallery use your DeviantART nickname.
        //
        // To fetch a gallery folder, add the id after a slash character.
        // Example:
        // Pick the gallery folder url: e.g.
        // http://giuliom.deviantart.com/gallery/30227724 .
        // Append the id, which is 30227724, to your nick obtaining
        // something like 'mgiulio/30227724'
        {
          service: 'deviantart',
          user: 'gabbyd70',
          template: {
            deviationpost: '<a href="http://gabbyd70.deviantart.com/">gabbyd70</a> uploaded a deviation: <a href="${url}">${title}</a>'
          }
        },
        {
          service: 'dribbble',
          user: 'flarup'
        },
        // find your flickr id @
        // http://www.flickr.com/services/api/explore/?method=flickr.people.findByUsername
        {
          service: 'flickr',
          user: '60378309@N02'
        },
        {
          service: 'foomark',
          user: 'thatryan'
        },
        {
          service: 'formspring',
          user: 'formspring'
        },
        {
          service: 'forrst',
          user: 'thatryan'
        },
        // Run javascript:alert(_USER_ID); when you're logged in at google reader
        {
          service: 'googlereader',
          user: '16243859758547797209'
        },
        {
          service: 'github',
          user: 'christianv'
        },
        // Go to instapaper.com, click Liked and open rss feed, copy last two parts of the url
        // including the slash
        {
          service: 'instapaper',
          user: '339501/W2nHbK9Bo4Q1wgd2irogorycEV0'
        },
        {
          service: 'iusethis',
          user: 'marcus'
        },
        {
          service: 'lastfm',
          user: 'denbuzze'
        },
        {
          service: 'mlkshk',
          user: 'billturner'
        },
        {
          service: 'picplz',
          user: 'thatryan'
        },
        {
          service: 'pinboard',
          user: 'mattandrews'
        },
        {
          service: 'posterous',
          user: 'techcrunch'
        },
        {
          service: 'reddit',
          user: 'simongee'
        },
        {
          service: 'slideshare',
          user: 'denbuzze'
        },
        {
          service: 'snipplr',
          user: 'sdxxx'
        },
        // Run javascript:alert(userid); when you're logged in at stackoverflow
        {
          service: 'stackoverflow',
          user: '117193'
        },
        {
          service: 'tumblr',
          user: 'hiromitz'
        },
        {
          service: 'twitter',
          user: 'jq_lifestream'
        },
        {
          service: 'vimeo',
          user: 'denbuzze'
        },
        {
          service: 'wordpress',
          user: 'pixartimes'
        },
        {
          service: 'youtube',
          user: 'denbuzze'
        }
      ];

      Date.prototype.toISO8601 = function(date) {
          var pad = function (amount, width) {
              var padding = "";
              while (padding.length < width - 1 && amount < Math.pow(10, width - padding.length - 1))
                  padding += "0";
              return padding + amount.toString();
          }
          date = date ? date : new Date();
          var offset = date.getTimezoneOffset();
          return pad(date.getFullYear(), 4)
              + "-" + pad(date.getMonth() + 1, 2)
              + "-" + pad(date.getDate(), 2)
              + "T" + pad(date.getHours(), 2)
              + ":" + pad(date.getMinutes(), 2)
              + ":" + pad(date.getUTCSeconds(), 2)
              + (offset > 0 ? "-" : "+")
              + pad(Math.floor(Math.abs(offset) / 60), 2)
              + ":" + pad(Math.abs(offset) % 60, 2);
      };

      $("#lifestream").lifestream({
        limit: 400,
        list: list,
        feedloaded: function(){
          count++;
          // Check if all the feeds have been loaded
          if( count === list.length ){
            $("#lifestream li").each(function(){
              var element = $(this),
                  date = new Date(element.data("time"));
              element.append(' <abbr class="timeago" title="' + date.toISO8601(date) + '">' + date + "</abbr>");
            })
            $("#lifestream .timeago").timeago();
          }
        }
      });
      
    })();
  </script>

  <script>
    var _gaq=[["_setAccount","UA-190225-11"],["_trackPageview"],["_trackPageLoadTime"]];
    (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
    g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
    s.parentNode.insertBefore(g,s)}(document,"script"));
  </script>

</body>
</html>
Something went wrong with that request. Please try again.