Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new /data/allposts and /weather examples of creating and consuming js…
…on data
- Loading branch information
1 parent
70888c3
commit ff25abe
Showing
4 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<div class="row"> | ||
|
||
<!-- LEFT COLUMN --> | ||
<div class="span6"> | ||
<h1><%= weather.location.city %> | ||
<img src="<%= weather.condition.image %>" alt="weather condition graphic : <%= weather.condition.text %>"> | ||
</h1> | ||
|
||
<hr> | ||
|
||
<ul> | ||
<li>Temperature: | ||
<%= weather.condition.text %> | ||
<%= weather.condition.temperature %> <%= weather.units.temperature %></li> | ||
<li>Wind speed: <%= weather.wind.speed %><%= weather.units.speed %> <%= weather.wind.direction %></li> | ||
<li>Visibility: <%= weather.atmosphere.visibility %><%= weather.units.distance %> | ||
</ul> | ||
|
||
<hr> | ||
|
||
<ul> | ||
<li>Sunrise: <%= weather.astronomy.sunrise %></li> | ||
<li>Sunset: <%= weather.astronomy.sunset %></li> | ||
</ul> | ||
|
||
<!-- location listing --> | ||
<br><br> | ||
<div class="well"> | ||
<h3>See weather in:</h3> | ||
<% for(place in YAHOOLocations) { %> | ||
<a href="/weather/<%= place %>"><%= place.toUpperCase() %></a> | ||
<% } %> | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
|
||
<!-- RIGHT COLUMN --> | ||
<div class="span6"> | ||
<h3>For example only, this is the JSON data from Yahoo</h3> | ||
<pre><%= jsonFromYahoo %></pre> | ||
<br> | ||
requested url:<br> | ||
<a href="<%= requestedURL %>" target="_new"><%= requestedURL %></a><br> | ||
|
||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters