Include Young Reporter Twitter feed on auto-refresh page

This commit is contained in:
Matthew Grove
2019-03-06 09:53:47 +00:00
parent 35343b8b50
commit 250088203b
2 changed files with 38 additions and 10 deletions

View File

@@ -1,18 +1,32 @@
<iframe id="iframe" src="/"></iframe>
<script src="/js/jquery.min.js"></script>
<iframe id="articles" src="/"></iframe>
<p><a class="twitter-timeline" id="tweets" data-dnt="true" href="https://twitter.com/BBCYoungReport?ref_src=twsrc%5Etfw">Tweets by BBCYoungReport</a> <script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<script>
window.setInterval(function() {
document.getElementById('iframe').contentWindow.location.reload();
}, 300000);
window.setInterval(function() {
document.getElementById('iframe').contentWindow.location.reload();
document.getElementsByClass('twitter-timeline')[0].contentWindow.location.reload();
}, 60000);
</script>
<style>
html, body {
width: 100%;
}
html, body, iframe {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
border: none;
}
#articles {
width: 70%;
float: left;
}
.twitter-timeline {
width: 30% !important;
float: right;
}
</style>

View File

@@ -4,20 +4,34 @@ description: News articles written by Reading School students in year 8
layout: none
---
<iframe id="iframe" src="/"></iframe>
<script src="/js/jquery.min.js"></script>
<iframe id="articles" src="/"></iframe>
<a class="twitter-timeline" id="tweets" data-dnt="true" href="https://twitter.com/BBCYoungReport?ref_src=twsrc%5Etfw">Tweets by BBCYoungReport</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script>
window.setInterval(function() {
document.getElementById('iframe').contentWindow.location.reload();
}, 300000);
window.setInterval(function() {
document.getElementById('iframe').contentWindow.location.reload();
document.getElementsByClass('twitter-timeline')[0].contentWindow.location.reload();
}, 60000);
</script>
<style>
html, body {
width: 100%;
}
html, body, iframe {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
border: none;
}
#articles {
width: 70%;
float: left;
}
.twitter-timeline {
width: 30% !important;
float: right;
}
</style>