Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var position = "", feed_url = "http://rss.orf.at/news.xml", data, result = document.createElement("div");
- document.body.innerHTML = "";
- document.body.appendChild(result);
- result.style.backgroundColor = "white";
- result.style.color = "black";
- result.style.padding = "10px";
- result.style.width = "660px";
- result.style.textAlign = "justify";
- result.style.overflowY = "visibile";
- var next = document.createElement("a");
- next.href = "#";
- next.innerHTML = "more";
- next.style.fontSize = "14pt";
- next.style.backgroundColor = "white";
- document.body.appendChild(next);
- next.onclick = function() {
- var a = new XMLHttpRequest;
- result.innerHTML = "updating... ";
- a.open("GET", "/jabry/q/dapi.asp?count=50&feed_url=" + encodeURIComponent(feed_url) + "&position=" + position, !0);
- a.onload = function() {
- result.innerHTML = "";
- data = JSON.parse(a.responseText);
- for (var c = 0, d = [], b;c < data.data.feed.length;c++) {
- b = data.data.feed[c], d.push('<h3><a href="' + b.content.url + '" target="_blank" rel="noreferrer">' + b.content.title + '</a></h3><div style="min-height:180px;overflow:visible;">' + (b.content.media.images.length ? '<img src="' + b.content.media.images[0].url.replace(/^https*:\/\//,'http://i'+(c%3)+'.wp.com/')+'?w=240' + '" style="float:left;max-width:240px;max-height:180px;margin-right:10px;">' : "") + (b.content.body||b.content.description) + "</div>");
- }
- result.innerHTML = d.join("\n");
- position = data.data.next_position;
- document.title=new Date(data.data.feed[0].date*1000).toString().substring(0,21);
- setTimeout(function(){
- var x = new XMLHttpRequest;
- x.open("GET", "/jabry/q/dapi.asp?count=50&feed_url=" + encodeURIComponent(feed_url) + "&position=" + position, !0);
- x.send();
- },1000);
- };
- a.send();
- return !1;
- };
- setTimeout(next.click(), 50);
- document.onkeypress = function(a) {
- 106 == a.keyCode && next.click();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement