Permalink
Browse files

trying to add last update time

  • Loading branch information...
edsu committed Sep 28, 2010
1 parent e9ce136 commit 8b6eac46b9a62f3918b08d35240003b878aeb9ac
Showing with 179 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +9 −3 ckan.py
  3. +15 −0 index.html
  4. +154 −0 jquery-1.4.2.min.js
View
@@ -1,2 +1,3 @@
ckan.log
lod.js
last_update.html
View
12 ckan.py
@@ -78,13 +78,19 @@ def protovis_javascript(packages):
def write_javascript(javascript):
"""safely writes protovis javascript to lod.js
"""safely writes protovis javascript to lod.js as well as
last_update.html that records the last time lod.js was updated.
"""
timestamp = datetime.strftime(datetime.now(), "%Y%m%dT%H%M%S")
tmp_file = "lod.js-%s" % timestamp
now = datetime.now()
tmp_file = "lod.js-%s" % datetime.strftime(now, "%Y%m%dT%H%M%S")
open(tmp_file, "w").write(javascript)
os.rename(tmp_file, "lod.js")
tz = time.tzname[1] if time.daylight else time.tzname[0]
timestamp = datetime.strftime(now, "%Y-%m-%d %H:%M:%S ") + tz
file("last_update.html", "w").write(timestamp)
def get_nodes(packages):
"""constructs a list of nodes suitable for protovis
View
@@ -3,6 +3,14 @@
<head>
<title>Linked Open Data Graph</title>
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// load the last update time for the lod.js
// allows index.html to stay a static file
$("#last_update").load("last_update.html");
});
</script>
<style type="text/css">
body {
margin-left: 10%;
@@ -27,6 +35,10 @@
}
#about {
}
#last_update {
font-style: italic;
text-align: center;
}
a {
font-weight: bold;
text-decoration: none;
@@ -43,6 +55,9 @@ <h1>Linked Open Data Graph</h1>
<a href="http://lod-cloud.net/">Linked Open Data Cloud</a>
using data made available by the
<a href="http://knowledgeforge.net/ckan/doc/ckan/api.html">CKAN API</a>.
<p id="last_update">
blah
</p>
</div>
<div id="graph_console">
<iframe id="graph" src="lod.html"></iframe>
Oops, something went wrong.

0 comments on commit 8b6eac4

Please sign in to comment.