Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Digital Experience Group
GoBigRed
Commits
ec911cb8
Commit
ec911cb8
authored
Sep 22, 2011
by
Seth Meranda
Browse files
Since we're on a PHP server, use PHP to parse and output the JSON feed instead of JS.
parent
40ad2098
Changes
1
Hide whitespace changes
Inline
Side-by-side
index.php
View file @
ec911cb8
...
...
@@ -171,8 +171,17 @@
<div
class=
"grid4"
id=
"newsItems"
>
<script
src=
"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D'http%3A%2F%2Fpipes.yahoo.com%2Fpipes%2Fpipe.run%3F_id%3D67df958f5c60c5217e7c28fb3b4556ff%26_render%3Drss'&format=json&diagnostics=true&callback=buildNews"
type=
"text/javascript"
></script>
</div>
<h3>
News from Nebraska
</h3>
<ul
id=
"newsList"
>
<?php
$news
=
json_decode
(
file_get_contents
(
"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D'http%3A%2F%2Fpipes.yahoo.com%2Fpipes%2Fpipe.run%3F_id%3D67df958f5c60c5217e7c28fb3b4556ff%26_render%3Drss'&format=json&diagnostics=true"
),
true
);
//print_r($news['query']['results']);
foreach
(
$news
[
'query'
][
'results'
][
'item'
]
as
$result
){
echo
'<li><a href="'
.
$result
[
'link'
]
.
'">'
.
$result
[
'title'
]
.
'</a></li>'
;
}
?>
</ul>
</div>
<!-- TemplateEndEditable -->
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment