Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: bruntonspall/guardian-publication-times
base: adb5d583ae
...
head fork: bruntonspall/guardian-publication-times
compare: a9e1ce9799
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 06, 2012
Michael Brunton-Spall Update index.html
Set a filtertag rather than content-type specific so we can filter by tone/feature if necessary.
3d93188
Michael Brunton-Spall Update js/control.js
Switch to allow multiple tags, not just content-type
26ed4a2
Michael Brunton-Spall Update README.md
Updated to point to original and update TODO list
a8f06bb
Michael Brunton-Spall Merge pull request #1 from bruntonspall/master
Update to not just be video.
a9e1ce9
Showing with 17 additions and 19 deletions.
  1. +9 −11 README.md
  2. +1 −1  index.html
  3. +7 −7 js/control.js
20 README.md
View
@@ -1,21 +1,19 @@
-Guardian Video Times
+Guardian Publication Times
====================
-Quick hack on the Guardian API to work out how many videos are published by the Guardian and *when*.
+Live version at http://bruntonspall.github.com/guardian-publication-times
-Only tested on Chrome.
+Forked from some great work by Dan Catt at
+ code: https://github.com/revdancatt/Guardian-Video-Times
+ running: http://revdancatt.github.com/Guardian-Video-Times/
+Quick hack on the Guardian API to work out how many items of content with a tag are published by the Guardian and *when*.
+
+Only tested on Chrome.
+
ToDo
====
-+ Show the current week rather than last week (not much on a Monday so far for testing)
-+ Allow the user to go back through weeks
-+ Little frames around the video thumbnails to show which section they belong to
-+ Click thru on the thumbs to the actual video
-+ Pop-over on each thumb to get more informaiton.
-+ "expand" the thumbs when rolled over if they are "clumped"
-+ So, so, so, much more
-+ Error checking
++ Everything Dan Said
++ Ability to select the filter tag by autocomplete/dropdown
2  index.html
View
@@ -292,7 +292,7 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/control.js?v=1.2"></script>
<script>
- var contenttype = 'video';
+ var filtertag = 'content/video';
$(document).ready(function() {
control.init();
});
14 js/control.js
View
@@ -25,13 +25,13 @@ control = {
control.endOfWeek = new Date(control.startOfWeek.getTime() + (1000*60*60*24*7));
// Stupidly long way to display the week we are currently looking at
- $('#topfeedback').html(contenttype + ' published in the week ' + control.startOfWeek.toString().split('00:00:00')[0] + ' - ' + new Date(control.endOfWeek.getTime() - 1000).toString().split('23:59:59')[0]);
+ $('#topfeedback').html(filtertag + ' published in the week ' + control.startOfWeek.toString().split('00:00:00')[0] + ' - ' + new Date(control.endOfWeek.getTime() - 1000).toString().split('23:59:59')[0]);
// Now add the dates onto the top of each row
control.displayDates();
// Now grab the video that has been published during that time.
- control.fetchVideoFeed();
+ control.fetchFeed();
}
);
@@ -71,17 +71,17 @@ control = {
},
- fetchVideoFeed: function() {
+ fetchFeed: function() {
if (this.pages === null) {
- $('#currentaction h1').html('Counting ' + contenttype);
+ $('#currentaction h1').html('Counting ' + filtertag);
} else {
- $('#currentaction h1').html('Counting ' + contenttype + ' ' + this.page + '/' + this.pages);
+ $('#currentaction h1').html('Counting ' + filtertag + ' ' + this.page + '/' + this.pages);
}
var fromdate = (control.startOfWeek.getYear() + 1900) + '-' + (control.startOfWeek.getMonth()+1) + '-' + control.startOfWeek.getDate();
var todate = (control.endOfWeek.getYear() + 1900) + '-' + (control.endOfWeek.getMonth()+1) + '-' + control.endOfWeek.getDate();
- $.getJSON('http://content.guardianapis.com/search?page=' + control.page + '&tag=type/' + contenttype + '&from-date=' + fromdate + '&to-date=' + todate + '&show-tags=series&order-by=oldest&format=json&show-fields=shortUrl,thumbnail&callback=?',
+ $.getJSON('http://content.guardianapis.com/search?page=' + control.page + '&tag=' + filtertag + '&from-date=' + fromdate + '&to-date=' + todate + '&show-tags=series&order-by=oldest&format=json&show-fields=shortUrl,thumbnail&callback=?',
// TODO: add error checking to this response
function(json) {
for (var i in json.response.results) {
@@ -92,7 +92,7 @@ control = {
control.pages = json.response.pages;
if (control.page < control.pages) {
control.page++;
- control.fetchVideoFeed();
+ control.fetchFeed();
} else {
if (json.response.total == 1) {
$('#currentaction h1').html('Done, 1 video');

No commit comments for this range

Something went wrong with that request. Please try again.