Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- nmax = 90;
- n = tumblr_api_read["posts-total"];
- if (n > nmax) n = nmax;
- for (i = 0; i < n; i++) {
- switch (tumblr_api_read["posts"][i]["type"]) {
- case "regular":
- kind = "text";
- label = tumblr_api_read["posts"][i]["regular-title"];
- col = "background: #fff";
- photourl = "";
- source = "";
- videoplayer = "";
- break;
- case "photo":
- kind = "photo";
- label = tumblr_api_read["posts"][i]["photo-caption"];
- photourl = "<img style='display: block; border:0px;' src='" + tumblr_api_read["posts"][i]["photo-url-400"] + "' />";
- col = "background: #fff";
- source = "";
- videoplayer = "";
- break;
- case "quote":
- kind = "quote";
- label = '"' + tumblr_api_read["posts"][i]["quote-text"] + '"';
- col = "background: #fff";
- source = tumblr_api_read["posts"][i]["quote-source"];
- photourl = "";
- videoplayer = "";
- break;
- case "link":
- kind = "link";
- label = tumblr_api_read["posts"][i]["link-text"];
- col = "background: #fff";
- photourl = "";
- source = "";
- videoplayer = "";
- break;
- case "chat":
- kind = "chat";
- label = "";
- col = "background: #fff";
- photourl = "";
- source = "";
- videoplayer = "";
- break;
- case "audio":
- kind = "audio";
- label = tumblr_api_read["posts"][i]["audio-caption"];
- col = "background: #fff";
- photourl = "";
- source = "";
- videoplayer = "";
- break;
- case "video":
- kind = "video";
- label = tumblr_api_read["posts"][i]["video-caption"];
- col = "background: #fff";
- photourl = "";
- source = "";
- videoplayer = tumblr_api_read["posts"][i]["video-player"] + "<br />";
- break;
- }
- // HTML ?????????
- label = label.replace(/<[^>]*?>/gi,"");
- // "(via )" ??????????
- //label = label.replace("(via )","");
- url = tumblr_api_read["posts"][i]["url"];
- document.write(
- '<div class="tumblr_post" class="', kind , '" style="', col, '">',
- '<a href="', url, '"><span class="tumblr_kind">',
- ' ', kind, ' </span>' ,
- '<div class="blackblack ', kind, '">',
- photourl, ' ',
- videoplayer, '',
- label, '<br /><br />',
- source,
- '</div></a></div>',
- " "
- );
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement