From 0ef0a5b229442fa720002e5ca6cfa87fae23f394 Mon Sep 17 00:00:00 2001 From: nemobis Date: Wed, 29 Jan 2014 15:55:16 +0000 Subject: [PATCH] Actually update last-updated-date git-svn-id: https://wikiteam.googlecode.com/svn/trunk@934 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95 --- uploader.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/uploader.py b/uploader.py index b928337..18e170a 100644 --- a/uploader.py +++ b/uploader.py @@ -210,10 +210,21 @@ def upload(wikis): curl += ['--upload-file', "%s" % (dump), "http://s3.us.archive.org/wiki-%s/%s" % (wikiname, dump), # It could happen that the identifier is taken by another user; only wikiteam collection admins will be able to upload more files to it, curl will fail immediately and get a permissions error by s3. ] + #now also to update the metadata + #TODO: not needed for the second file in an item + curlmeta = ['curl', + '--data-urlencode -target=metadata', + """--data-urlencode -patch='{"replace":"/last-updated-date", "value":"%s"}'""" % (wikidate_text), + '--data-urlencode access=' + accesskey, + '--data-urlencode secret=' + secretkey, + 'http://archive.org/metadata/wiki-' + wikiname > /dev/null + ] curlline = ' '.join(curl) - if os.system(curlline): + curlmetaline = ' '.join(curlmeta) + if not os.system(curlline): uploadeddumps.append(dump) log(wiki, dump, 'ok') + os.system(curlmetaline) c += 1 def main():