commit 174ebf4e13409da5168bb6ed65146e6ef7e3f873 Author: kevinmidboe Date: Wed Sep 21 12:28:14 2016 +0000 First com, added hmtl folder diff --git a/fonts/Roboto-Thin.ttf b/fonts/Roboto-Thin.ttf new file mode 100755 index 0000000..861d63a Binary files /dev/null and b/fonts/Roboto-Thin.ttf differ diff --git a/fonts/pixelHype.ttf b/fonts/pixelHype.ttf new file mode 100755 index 0000000..dcca687 Binary files /dev/null and b/fonts/pixelHype.ttf differ diff --git a/images/cal/August.png b/images/cal/August.png new file mode 100644 index 0000000..540f7b8 Binary files /dev/null and b/images/cal/August.png differ diff --git a/images/cal/Elias.png b/images/cal/Elias.png new file mode 100644 index 0000000..3fc130a Binary files /dev/null and b/images/cal/Elias.png differ diff --git a/images/cal/Kevin.png b/images/cal/Kevin.png new file mode 100644 index 0000000..9f3bf01 Binary files /dev/null and b/images/cal/Kevin.png differ diff --git a/images/day/Clear sky.png b/images/day/Clear sky.png new file mode 100644 index 0000000..d3235e0 Binary files /dev/null and b/images/day/Clear sky.png differ diff --git a/images/day/Cloudy.png b/images/day/Cloudy.png new file mode 100644 index 0000000..68bc36f Binary files /dev/null and b/images/day/Cloudy.png differ diff --git a/images/day/Fair.png b/images/day/Fair.png new file mode 100644 index 0000000..70aac99 Binary files /dev/null and b/images/day/Fair.png differ diff --git a/images/day/Fog.png b/images/day/Fog.png new file mode 100644 index 0000000..50d6439 Binary files /dev/null and b/images/day/Fog.png differ diff --git a/images/day/Heavy rain and thunder.png b/images/day/Heavy rain and thunder.png new file mode 100644 index 0000000..fd36a6a Binary files /dev/null and b/images/day/Heavy rain and thunder.png differ diff --git a/images/day/Heavy rain showers and thunder.png b/images/day/Heavy rain showers and thunder.png new file mode 100644 index 0000000..e94bf40 Binary files /dev/null and b/images/day/Heavy rain showers and thunder.png differ diff --git a/images/day/Heavy rain showers.png b/images/day/Heavy rain showers.png new file mode 100644 index 0000000..69bc188 Binary files /dev/null and b/images/day/Heavy rain showers.png differ diff --git a/images/day/Heavy rain.png b/images/day/Heavy rain.png new file mode 100644 index 0000000..8f73dcc Binary files /dev/null and b/images/day/Heavy rain.png differ diff --git a/images/day/Heavy sleet and thunder.png b/images/day/Heavy sleet and thunder.png new file mode 100644 index 0000000..c9e6549 Binary files /dev/null and b/images/day/Heavy sleet and thunder.png differ diff --git a/images/day/Heavy sleet showers and thunder.png b/images/day/Heavy sleet showers and thunder.png new file mode 100644 index 0000000..cc371a8 Binary files /dev/null and b/images/day/Heavy sleet showers and thunder.png differ diff --git a/images/day/Heavy sleet showers.png b/images/day/Heavy sleet showers.png new file mode 100644 index 0000000..20c74c0 Binary files /dev/null and b/images/day/Heavy sleet showers.png differ diff --git a/images/day/Heavy sleet.png b/images/day/Heavy sleet.png new file mode 100644 index 0000000..b69a94b Binary files /dev/null and b/images/day/Heavy sleet.png differ diff --git a/images/day/Heavy snow and thunder.png b/images/day/Heavy snow and thunder.png new file mode 100644 index 0000000..ad20284 Binary files /dev/null and b/images/day/Heavy snow and thunder.png differ diff --git a/images/day/Heavy snow showers and thunder.png b/images/day/Heavy snow showers and thunder.png new file mode 100644 index 0000000..d658128 Binary files /dev/null and b/images/day/Heavy snow showers and thunder.png differ diff --git a/images/day/Heavy snow showers.png b/images/day/Heavy snow showers.png new file mode 100644 index 0000000..f2a94f3 Binary files /dev/null and b/images/day/Heavy snow showers.png differ diff --git a/images/day/Heavy snow.png b/images/day/Heavy snow.png new file mode 100644 index 0000000..969090f Binary files /dev/null and b/images/day/Heavy snow.png differ diff --git a/images/day/Light rain and thunder.png b/images/day/Light rain and thunder.png new file mode 100644 index 0000000..dfcaafe Binary files /dev/null and b/images/day/Light rain and thunder.png differ diff --git a/images/day/Light rain showers and thunder.png b/images/day/Light rain showers and thunder.png new file mode 100644 index 0000000..3cc2934 Binary files /dev/null and b/images/day/Light rain showers and thunder.png differ diff --git a/images/day/Light rain showers.png b/images/day/Light rain showers.png new file mode 100644 index 0000000..7d4f842 Binary files /dev/null and b/images/day/Light rain showers.png differ diff --git a/images/day/Light rain.png b/images/day/Light rain.png new file mode 100644 index 0000000..4698ced Binary files /dev/null and b/images/day/Light rain.png differ diff --git a/images/day/Light sleet and thunder.png b/images/day/Light sleet and thunder.png new file mode 100644 index 0000000..cefb4e4 Binary files /dev/null and b/images/day/Light sleet and thunder.png differ diff --git a/images/day/Light sleet showers and thunder.png b/images/day/Light sleet showers and thunder.png new file mode 100644 index 0000000..0a80c3a Binary files /dev/null and b/images/day/Light sleet showers and thunder.png differ diff --git a/images/day/Light sleet showers.png b/images/day/Light sleet showers.png new file mode 100644 index 0000000..e6891bc Binary files /dev/null and b/images/day/Light sleet showers.png differ diff --git a/images/day/Light sleet.png b/images/day/Light sleet.png new file mode 100644 index 0000000..cf44566 Binary files /dev/null and b/images/day/Light sleet.png differ diff --git a/images/day/Light snow and thunder.png b/images/day/Light snow and thunder.png new file mode 100644 index 0000000..0a6e2af Binary files /dev/null and b/images/day/Light snow and thunder.png differ diff --git a/images/day/Light snow showers and thunder.png b/images/day/Light snow showers and thunder.png new file mode 100644 index 0000000..2b0f6e5 Binary files /dev/null and b/images/day/Light snow showers and thunder.png differ diff --git a/images/day/Light snow showers.png b/images/day/Light snow showers.png new file mode 100644 index 0000000..848f276 Binary files /dev/null and b/images/day/Light snow showers.png differ diff --git a/images/day/Light snow.png b/images/day/Light snow.png new file mode 100644 index 0000000..3b2f41b Binary files /dev/null and b/images/day/Light snow.png differ diff --git a/images/day/Partly cloudy.png b/images/day/Partly cloudy.png new file mode 100644 index 0000000..ca797cb Binary files /dev/null and b/images/day/Partly cloudy.png differ diff --git a/images/day/Rain and thunder.png b/images/day/Rain and thunder.png new file mode 100644 index 0000000..bba1c02 Binary files /dev/null and b/images/day/Rain and thunder.png differ diff --git a/images/day/Rain showers and thunder.png b/images/day/Rain showers and thunder.png new file mode 100644 index 0000000..4e43889 Binary files /dev/null and b/images/day/Rain showers and thunder.png differ diff --git a/images/day/Rain showers.png b/images/day/Rain showers.png new file mode 100644 index 0000000..e1c322c Binary files /dev/null and b/images/day/Rain showers.png differ diff --git a/images/day/Rain.png b/images/day/Rain.png new file mode 100644 index 0000000..cd2449a Binary files /dev/null and b/images/day/Rain.png differ diff --git a/images/day/Sleet and thunder.png b/images/day/Sleet and thunder.png new file mode 100644 index 0000000..8891a3c Binary files /dev/null and b/images/day/Sleet and thunder.png differ diff --git a/images/day/Sleet showers and thunder.png b/images/day/Sleet showers and thunder.png new file mode 100644 index 0000000..5a00984 Binary files /dev/null and b/images/day/Sleet showers and thunder.png differ diff --git a/images/day/Sleet showers.png b/images/day/Sleet showers.png new file mode 100644 index 0000000..287d32f Binary files /dev/null and b/images/day/Sleet showers.png differ diff --git a/images/day/Sleet.png b/images/day/Sleet.png new file mode 100644 index 0000000..46b3a48 Binary files /dev/null and b/images/day/Sleet.png differ diff --git a/images/day/Snow and thunder.png b/images/day/Snow and thunder.png new file mode 100644 index 0000000..e410788 Binary files /dev/null and b/images/day/Snow and thunder.png differ diff --git a/images/day/Snow showers and thunder.png b/images/day/Snow showers and thunder.png new file mode 100644 index 0000000..dea5e77 Binary files /dev/null and b/images/day/Snow showers and thunder.png differ diff --git a/images/day/Snow showers.png b/images/day/Snow showers.png new file mode 100644 index 0000000..617232f Binary files /dev/null and b/images/day/Snow showers.png differ diff --git a/images/day/Snow.png b/images/day/Snow.png new file mode 100644 index 0000000..eb5b799 Binary files /dev/null and b/images/day/Snow.png differ diff --git a/images/night/Clear sky.png b/images/night/Clear sky.png new file mode 100644 index 0000000..8b248ab Binary files /dev/null and b/images/night/Clear sky.png differ diff --git a/images/night/Cloudy.png b/images/night/Cloudy.png new file mode 100644 index 0000000..68bc36f Binary files /dev/null and b/images/night/Cloudy.png differ diff --git a/images/night/Fair.png b/images/night/Fair.png new file mode 100644 index 0000000..1bb2fbe Binary files /dev/null and b/images/night/Fair.png differ diff --git a/images/night/Fog.png b/images/night/Fog.png new file mode 100644 index 0000000..50d6439 Binary files /dev/null and b/images/night/Fog.png differ diff --git a/images/night/Heavy rain showers and thunder.png b/images/night/Heavy rain showers and thunder.png new file mode 100644 index 0000000..6b71403 Binary files /dev/null and b/images/night/Heavy rain showers and thunder.png differ diff --git a/images/night/Heavy rain showers.png b/images/night/Heavy rain showers.png new file mode 100644 index 0000000..0e839df Binary files /dev/null and b/images/night/Heavy rain showers.png differ diff --git a/images/night/Heavy rain.png b/images/night/Heavy rain.png new file mode 100644 index 0000000..8f73dcc Binary files /dev/null and b/images/night/Heavy rain.png differ diff --git a/images/night/Heavy sleet and thunder.png b/images/night/Heavy sleet and thunder.png new file mode 100644 index 0000000..c9e6549 Binary files /dev/null and b/images/night/Heavy sleet and thunder.png differ diff --git a/images/night/Heavy sleet showers and thunder.png b/images/night/Heavy sleet showers and thunder.png new file mode 100644 index 0000000..b25d35a Binary files /dev/null and b/images/night/Heavy sleet showers and thunder.png differ diff --git a/images/night/Heavy sleet showers.png b/images/night/Heavy sleet showers.png new file mode 100644 index 0000000..0615b66 Binary files /dev/null and b/images/night/Heavy sleet showers.png differ diff --git a/images/night/Heavy sleet.png b/images/night/Heavy sleet.png new file mode 100644 index 0000000..b69a94b Binary files /dev/null and b/images/night/Heavy sleet.png differ diff --git a/images/night/Heavy snow and thunder.png b/images/night/Heavy snow and thunder.png new file mode 100644 index 0000000..ad20284 Binary files /dev/null and b/images/night/Heavy snow and thunder.png differ diff --git a/images/night/Heavy snow showers and thunder.png b/images/night/Heavy snow showers and thunder.png new file mode 100644 index 0000000..52696e9 Binary files /dev/null and b/images/night/Heavy snow showers and thunder.png differ diff --git a/images/night/Heavy snow showers.png b/images/night/Heavy snow showers.png new file mode 100644 index 0000000..bad9006 Binary files /dev/null and b/images/night/Heavy snow showers.png differ diff --git a/images/night/Heavy snow.png b/images/night/Heavy snow.png new file mode 100644 index 0000000..969090f Binary files /dev/null and b/images/night/Heavy snow.png differ diff --git a/images/night/Light rain and thunder.png b/images/night/Light rain and thunder.png new file mode 100644 index 0000000..dfcaafe Binary files /dev/null and b/images/night/Light rain and thunder.png differ diff --git a/images/night/Light rain showers and thunder.png b/images/night/Light rain showers and thunder.png new file mode 100644 index 0000000..9390893 Binary files /dev/null and b/images/night/Light rain showers and thunder.png differ diff --git a/images/night/Light rain showers.png b/images/night/Light rain showers.png new file mode 100644 index 0000000..4858870 Binary files /dev/null and b/images/night/Light rain showers.png differ diff --git a/images/night/Light rain.png b/images/night/Light rain.png new file mode 100644 index 0000000..4698ced Binary files /dev/null and b/images/night/Light rain.png differ diff --git a/images/night/Light sleet and thunder.png b/images/night/Light sleet and thunder.png new file mode 100644 index 0000000..cefb4e4 Binary files /dev/null and b/images/night/Light sleet and thunder.png differ diff --git a/images/night/Light sleet showers and thunder.png b/images/night/Light sleet showers and thunder.png new file mode 100644 index 0000000..d3acad0 Binary files /dev/null and b/images/night/Light sleet showers and thunder.png differ diff --git a/images/night/Light sleet showers.png b/images/night/Light sleet showers.png new file mode 100644 index 0000000..beb8c2a Binary files /dev/null and b/images/night/Light sleet showers.png differ diff --git a/images/night/Light sleet.png b/images/night/Light sleet.png new file mode 100644 index 0000000..cf44566 Binary files /dev/null and b/images/night/Light sleet.png differ diff --git a/images/night/Light snow and thunder.png b/images/night/Light snow and thunder.png new file mode 100644 index 0000000..0a6e2af Binary files /dev/null and b/images/night/Light snow and thunder.png differ diff --git a/images/night/Light snow showers and thunder.png b/images/night/Light snow showers and thunder.png new file mode 100644 index 0000000..94d421a Binary files /dev/null and b/images/night/Light snow showers and thunder.png differ diff --git a/images/night/Light snow showers.png b/images/night/Light snow showers.png new file mode 100644 index 0000000..e2c1a2a Binary files /dev/null and b/images/night/Light snow showers.png differ diff --git a/images/night/Light snow.png b/images/night/Light snow.png new file mode 100644 index 0000000..3b2f41b Binary files /dev/null and b/images/night/Light snow.png differ diff --git a/images/night/Partly cloudy.png b/images/night/Partly cloudy.png new file mode 100644 index 0000000..6f36de3 Binary files /dev/null and b/images/night/Partly cloudy.png differ diff --git a/images/night/Rain and thunder.png b/images/night/Rain and thunder.png new file mode 100644 index 0000000..bba1c02 Binary files /dev/null and b/images/night/Rain and thunder.png differ diff --git a/images/night/Rain showers and thunder.png b/images/night/Rain showers and thunder.png new file mode 100644 index 0000000..a410c39 Binary files /dev/null and b/images/night/Rain showers and thunder.png differ diff --git a/images/night/Rain showers.png b/images/night/Rain showers.png new file mode 100644 index 0000000..ad714ba Binary files /dev/null and b/images/night/Rain showers.png differ diff --git a/images/night/Rain.png b/images/night/Rain.png new file mode 100644 index 0000000..cd2449a Binary files /dev/null and b/images/night/Rain.png differ diff --git a/images/night/Sleet and thunder.png b/images/night/Sleet and thunder.png new file mode 100644 index 0000000..8891a3c Binary files /dev/null and b/images/night/Sleet and thunder.png differ diff --git a/images/night/Sleet showers and thunder.png b/images/night/Sleet showers and thunder.png new file mode 100644 index 0000000..9b985c0 Binary files /dev/null and b/images/night/Sleet showers and thunder.png differ diff --git a/images/night/Sleet showers.png b/images/night/Sleet showers.png new file mode 100644 index 0000000..e13dfee Binary files /dev/null and b/images/night/Sleet showers.png differ diff --git a/images/night/Sleet.png b/images/night/Sleet.png new file mode 100644 index 0000000..46b3a48 Binary files /dev/null and b/images/night/Sleet.png differ diff --git a/images/night/Snow and thunder.png b/images/night/Snow and thunder.png new file mode 100644 index 0000000..e410788 Binary files /dev/null and b/images/night/Snow and thunder.png differ diff --git a/images/night/Snow showers and thunder.png b/images/night/Snow showers and thunder.png new file mode 100644 index 0000000..4af772d Binary files /dev/null and b/images/night/Snow showers and thunder.png differ diff --git a/images/night/Snow showers.png b/images/night/Snow showers.png new file mode 100644 index 0000000..d82665f Binary files /dev/null and b/images/night/Snow showers.png differ diff --git a/images/night/Snow.png b/images/night/Snow.png new file mode 100644 index 0000000..eb5b799 Binary files /dev/null and b/images/night/Snow.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..6dec001 --- /dev/null +++ b/index.php @@ -0,0 +1,95 @@ + + + + + + + + + + + RPi Home Hub v0.1 + + +
+
+
+

/r/showerthoughts

+

+ +

+
+
+ +
+

+ + + + +
+ +
+
+ +
+

+

+

+

+
+ +
+ +
+

@Politiet

+ +
+ +
+

Siste fra ap.no

+ + + +
+ +
+

Siste fra db.no

+ + + +
+ + + + + + + + + + + diff --git a/phpFiles/apRss.php b/phpFiles/apRss.php new file mode 100644 index 0000000..988d0e9 --- /dev/null +++ b/phpFiles/apRss.php @@ -0,0 +1,21 @@ +load('http://www.aftenposten.no/eksport/rss-1_0/'); + $feed = array(); + foreach ($rss->getElementsByTagName('item') as $node) { + $item = array ( + 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, + 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, + 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, + ); + array_push($feed, $item); + } + $limit = 4; + for($x=0;$x<$limit;$x++) { + $title = str_replace(' & ', ' & ', $feed[$x]['title']); + $link = $feed[$x]['link']; + $description = $feed[$x]['desc']; + echo '

'.$title.'
'; + echo '

'.$description.'

'; + } +?> \ No newline at end of file diff --git a/phpFiles/dbRss.php b/phpFiles/dbRss.php new file mode 100644 index 0000000..aea8057 --- /dev/null +++ b/phpFiles/dbRss.php @@ -0,0 +1,21 @@ +load('http://www.dagbladet.no/rss/nyheter/'); + $feed = array(); + foreach ($rss->getElementsByTagName('item') as $node) { + $item = array ( + 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, + 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, + 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, + ); + array_push($feed, $item); + } + $limit = 4; + for($x=0;$x<$limit;$x++) { + $title = str_replace(' & ', ' & ', $feed[$x]['title']); + $link = $feed[$x]['link']; + $description = $feed[$x]['desc']; + echo '

'.$title.'
'; + echo '

'.$description.'

'; + } +?> diff --git a/scripts/3minReload.js b/scripts/3minReload.js new file mode 100644 index 0000000..6232a2b --- /dev/null +++ b/scripts/3minReload.js @@ -0,0 +1,3 @@ +setInterval(function() { + window.location.reload(); +}, 300000); \ No newline at end of file diff --git a/scripts/addWeatherInfo.js b/scripts/addWeatherInfo.js new file mode 100644 index 0000000..786b773 --- /dev/null +++ b/scripts/addWeatherInfo.js @@ -0,0 +1,15 @@ +var weatherData = []; +$.get('weatherData.txt', function(data) { + weatherData = data.split("\n"); + var elem = document.createElement("img"); + elem.setAttribute("src", 'images/' + weatherData[0] + '/' + weatherData[1]); + elem.setAttribute("height", "180"); + elem.setAttribute("width", "180"); + elem.setAttribute("alt", weatherData[1]); + document.getElementById("weatherImg").appendChild(elem); + + document.getElementById("weatherTempValue").innerHTML = "

Temperatur

" + weatherData[2] + '°

'; + document.getElementById("weatherRainfall").innerHTML = "

Nedbør

" + weatherData[3] + '

'; + document.getElementById("weatherWind").innerHTML = "

Vind

" + weatherData[5] + '

'; + document.getElementById("weatherWindDirection").innerHTML = "

Vind rettning

" + weatherData[6] + '

'; +}); \ No newline at end of file diff --git a/scripts/cycleTimeplaner.js b/scripts/cycleTimeplaner.js new file mode 100644 index 0000000..95e94cc --- /dev/null +++ b/scripts/cycleTimeplaner.js @@ -0,0 +1,28 @@ +var imageIndex = 0; +changeBanner(); + function changeBanner(){ + var img = []; + + var timetableImages = document.getElementById('timetables'); + img[0] = timetableImages.getElementsByTagName('img')[0]; + img[1] = timetableImages.getElementsByTagName('img')[1]; + img[2] = timetableImages.getElementsByTagName('img')[2]; + + for (var i = 0; i < img.length; i++) { + img[i].style.display = 'none'; + } + img[imageIndex].style.display = 'block'; + var src = img[imageIndex].src; + + if(src.indexOf('/') >= 0) { + src = src.substring(src.lastIndexOf('/')+1); + src = src.replace('.png', ' sin timeplan'); + document.getElementById('calTitle').innerHTML = src; + } + + if (imageIndex == img.length - 1) { + imageIndex = 0; + } else { imageIndex++; } + } + + setInterval('changeBanner()', 5000); \ No newline at end of file diff --git a/scripts/timeDateDisplay.js b/scripts/timeDateDisplay.js new file mode 100644 index 0000000..0db2e37 --- /dev/null +++ b/scripts/timeDateDisplay.js @@ -0,0 +1,31 @@ +var weekday = new Array(7); + weekday[0]= "Søndag"; + weekday[1] = "Mandag"; + weekday[2] = "Tirsdag"; + weekday[3] = "Onsdag"; + weekday[4] = "Torsdag"; + weekday[5] = "Fredag"; + weekday[6] = "Lørdag"; + +(function () { + function checkTime(i) { + return (i < 10) ? "0" + i : i; + } + + function startTime() { + var today = new Date(), + h = checkTime(today.getHours()), + m = checkTime(today.getMinutes()), + s = checkTime(today.getSeconds()); + dn = weekday[today.getDay()]; + d = checkTime(today.getDate()); + mon = checkTime(today.getMonth() + 1); + y = checkTime(today.getFullYear()); + document.getElementById('currTime').innerHTML = + "

" + h + ":" + m + ":" + s + "

" + dn + " " + d + "." + mon + "." + y + "

"; + t = setTimeout(function () { + startTime() + }, 500); + } + startTime(); +})(); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..df661d3 --- /dev/null +++ b/style.css @@ -0,0 +1,121 @@ +@font-face { font-family: pixelHype; src: url('fonts/Roboto-Thin.ttf');} + +html, body { + font-family: pixelHype; + font-size: 24px; + padding: 20px; +} + +#time { + border: solid; + border-width: 1.5px; + border-color: black; + border-radius: 8px; + background-color: black; + color: white; + padding: 3px; + font-size: 58px; +} + +#showerthoughts h3 { + border: solid; + border-width: 1.5px; + border-color: black; + border-radius: 8px; + background-color: black; + color: white; + clear:both; + float:left; + padding: 3px; +} + +#showerthoughts p { + text-align: left; + clear: both; + float: left; +} + +.weatherReport { + margin-right: -30px; + margin-left: -30px; +} + +.weatherTitle { + width: 50%; + float: left; + text-align: right; + padding-right: 15px; +} + +.weatherData { + width: 50%; + float:right; + text-align: left; + padding-left: 15px; +} + +#rssTitle { + border: solid; + border-width: 1.5px; + border-color: black; + border-radius: 8px; + background-color: black; + color: white; + width: 165px; + padding: 3px; +} + +#rssFeed { + font-size: 15px; +} + +#twitterTitle { + border: solid; + border-width: 1.5px; + border-color: black; + border-radius: 8px; + background-color: black; + color: white; + clear:both; + float:left; + padding: 3px; + margin-left: 8px; +} + +.twitterFeed { + border: solid; + border-width: 1px; + border-color: black; + border-radius: 8px; + + padding-left: 8px; +} + +#calTitle { + border: solid; + border-width: 1.5px; + border-color: black; + border-radius: 8px; + background-color: black; + color: white; + clear:both; + float:left; + padding: 3px; +} + +#timetables { + width: 735px; + padding-bottom: 20px; + margin-left: 20px; + margin-right: 45px; + margin-bottom: 20px; + + border: solid; + border-width: 1px; + border-color: black; + border-radius: 8px; +} + +#timetables img { + display: none; +} diff --git a/topRedditPost.py b/topRedditPost.py new file mode 100644 index 0000000..29ad04a --- /dev/null +++ b/topRedditPost.py @@ -0,0 +1,83 @@ +import praw +import ephem +import requests + +user_agent = ("topRedditPost pyMachine 0.1") +submissionArray = [] + +weatherURL = 'http://www.yr.no/place/Norway/Oslo/Oslo/Ljabru/hour_by_hour.html' +weatherURL1 = 'http://www.yr.no/place/Norway/Sør-Trøndelag/Trondheim/Utleirvegen/hour_by_hour.html' +stringId = '') - 2] + forcastList = forcastDescription.split(', ') + + # Get the worded weather state + weatherState = forcastList[0] + while True: + try: + weatherState.index(':') + weatherState = weatherState[weatherState.index(':') + 2:] + pass + except ValueError: + forcastList[0] = weatherState + '.png' + break + + # Get the temp value + tempValue = forcastList[1] + forcastList[1] = tempValue[12:] + + # Clean up any errors in the downpour + try: + forcastList[2] = forcastList[2].replace("\\xe2\\x80\\x93", "-") + except ValueError: + pass + + # Get the wind value and append the direction of the wind + windValue = windDir = forcastList[4] + windValue = windValue[:windValue.index('from') - 1] + windDir = windDir[windDir.index('from') + len('from') + 1:] + forcastList[4] = windValue + forcastList.append(windDir) + + # Get the time of day + forcastList.insert(0,timeOfDay()) + + print(forcastList) + with open('weatherData.txt', 'w') as outputFile: + for element in forcastList: + outputFile.write(str(element) + '\n') + +def main(): + getShowerThought() + getWeatherReport() + +main() \ No newline at end of file diff --git a/topSubPost.txt b/topSubPost.txt new file mode 100644 index 0000000..33c0152 --- /dev/null +++ b/topSubPost.txt @@ -0,0 +1 @@ +"No Man's Land" is a great name for a lesbian bar \ No newline at end of file diff --git a/weatherData.txt b/weatherData.txt new file mode 100644 index 0000000..857d910 --- /dev/null +++ b/weatherData.txt @@ -0,0 +1,7 @@ +day +Snow.png +-6 +0.4 - 0.7 mm +Gentle breeze +6 m/s +northeast