# HG changeset patch # User Matthew Wild # Date 1333228412 -3600 # Node ID 5c9d6eba65bcfe983a503dee5c6fd2e79d36123b # Parent 102ae45e5b9674ff48c951f0caac38967da48b89 parse.lua: Update for gsoc12.csv, and *hack* the code to work with the new format diff -r 102ae45e5b96 -r 5c9d6eba65bc parse.lua --- a/parse.lua Sat Mar 31 22:10:15 2012 +0100 +++ b/parse.lua Sat Mar 31 22:13:32 2012 +0100 @@ -2,10 +2,14 @@ local have_https, https = pcall(require,"https"); local csv = require "csv" -for line in io.lines("gsoc10.csv") do +for line in io.lines(arg[1] or "gsoc12.csv") do local project = {}; csv.read_record(line, function (v) project[#project+1] = v; end); - local url = project[5]:match("https?://[^\"]+"); + -- FIXME: The original code doesn't work this year, + -- I think csv.lua doesn't handle quoted values + -- (ie. the 'Tags' column) properly. + --local url = project[5]:match("https?://[^\"]+"); + local url = line:match(",([^,]+)$"); if url and url:match("^http"..(have_https and "s?" or "")..":") then local data, err = http.request(url); if not data then