Repository navigation
Expand file tree
/
Copy pathrss.html
More file actions
executable file
·165 lines (116 loc) · 3.93 KB
/
Copy pathrss.html
File metadata and controls
executable file
·165 lines (116 loc) · 3.93 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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="/lib/masonry/masonry.pkgd.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Mallanna:400,700' rel='stylesheet' type='text/css'>
<style>
body
{
margin: 0;
font-family: 'Mallanna', sans-serif;
}
#header
{
height: 60px;
background: lightskyblue;
margin: 0 0 20px 0;
}
#footer
{
background: #ddd;
height: 60px;
width: 100%;
position: fixed;
bottom: 0;
}
#content
{
margin-bottom: 80px;;
}
#content .stories .title
{
width: 280px;
margin: 5px 10px;
font-weight: bold;
line-height: 18px;;
}
#content .stories img
{
width: 300px !important;
height: auto !important;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
#content .stories p
{
text-align: left !important;
font-size: 13px;
line-height: 16px;
}
#content .stories p:nth-child(n+2)
{
width: 280px;
margin: 10px 10px;
}
#content .stories
{
float: left;
width: 300px;
margin: 0 0px 20px 20px;
border-radius: 10px;
border: 1px solid #ddd;
}
</style>
<script type="text/javascript">
google.load("feeds", "1");
function formatContent(sContent)
{
sFind = $(sContent);
sFound = $("img", sFind).attr("src");
console.log(sFound);
}
function initialize() {
var feed = new google.feeds.Feed("http://mobile.engadget.com/rss.xml");
feed.setResultFormat(google.feeds.Feed.JSON_FORMAT);
feed.setNumEntries(20);
feed.load(function(result) {
if (!result.error) {
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var $stories = $("<div class='stories' id='story_" + i + "'></div>");
//var $img = $("<div class='image-holder'></div>");
var $title = $("<div class='title'></div>");
var $content = $("<div class='content'></div>");
//$stories.append($img);
$stories.append($title);
$stories.append($content);
$("#content").append($stories);
//$("#content #story_" + i + " .image-holder").html(formatContent(entry.content));
$("#content #story_" + i + " .title").text(entry.title);
$("#content #story_" + i + " .content").html(entry.content);
//$("#content").append("<div>" + formatContent(entry.content) + "</div>");
}
$(document).ready(function(){
$('img').load(function() {
$('#content').masonry({
// options
itemSelector: '.stories',
columnWidth: 10
});
});
});
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="header">
</div>
<div id="content"></div>
<div id="footer"></div>
</body>
</html>