-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbarcaNews.html
69 lines (65 loc) · 2.97 KB
/
barcaNews.html
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
<html>
<head><title>Barcelona RSS stream</title>
<!-- Latest compiled and minified CSS -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> -->
<!-- Optional theme
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">-->
<!--<link rel="stylesheet" href="bootstrap.css">-->
<!-- Latest compiled and minified JavaScript --><!--
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> -->
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/popper-1.12.5.js"></script>
<script src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/bootstrap.css" />
<style type='text/css'>
#results{ width: 100%;
/* margin-left: 30%; */
/* border: 1px solid gray; */
/* padding: 5px;
height: 200px; */
overflow: auto; }
h1, .h1, h2, .h2, h3, .h3 , strong {
color : #004D98 ;
}
</style>
<script type='text/javascript'>
function reload(){
//loadScript('http://query.yahooapis.com/v1/public/yql?q=select+*+from+rss+where+url%3D"http%3A%2F%2Fwww.fcbarcelona.com%2Ffootball%2Flist%2Farticles.rss"&format=json&callback=top_stories');
loadScript('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22https%3A%2F%2Ffeedity.com%2Ffcbarcelona-com%2FWlZbWlpR.rss%22&format=json&diagnostics=true&callback=top_stories');
}
// Parses returned response and extracts
// the title, links, and text of each news story.
function top_stories(o){
var items = o.query.results.item;
var output = '';
var no_items=items.length;
for(var i=0;i<no_items;i++){
var title = items[i].title;
var link = items[i].link;
var desc = items[i].description;
output += "<h3><a href='" + link + "'>"+title+"</a></h3>" + desc + "<hr/>";
}
// Place news stories in div tag
document.getElementById('results').innerHTML = output;
}
function loadScript(script_url)
{
var head= document.getElementsByTagName('head')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= script_url;
head.appendChild(script);
}
</script>
</head>
<body>
<!-- used for reloading the news
<input type="button" onclick="reload();" value="reload stories"/>
-->
<!-- Div tag for stories results -->
<div id='results'></div>
<!-- The YQL statment will be assigned to src. -->
<script src='https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22https%3A%2F%2Ffeedity.com%2Ffcbarcelona-com%2FWlZbWlpR.rss%22&format=json&diagnostics=true&callback=top_stories'>
</script>
</body>
</html>