@@ -338,13 +338,6 @@ func generateSummary(urir string, basetm *list.List, format string, dataCh chan
338
338
start := time .Now ()
339
339
defer benchmarker ("AGGREGATOR" , "serialize" , fmt .Sprintf ("%d mementos serialized" , basetm .Len ()), start , sess )
340
340
defer close (dataCh )
341
-
342
- dataCh <- fmt .Sprintf ("{\n " + ` "original_uri": "%s",` + "\n " , urir )
343
- //dataCh <- fmt.Sprintf(`!keys ["memento_datetime_YYYYMMDDhhmmss"]` + "\n")
344
- //dataCh <- fmt.Sprintf(`!meta {"original_uri": "%s"}`+"\n", urir)
345
- //dataCh <- fmt.Sprintf(`!meta {"timegate_uri": "%s/timegate/%s"}`+"\n", *proxy, urir)
346
- // dataCh <- fmt.Sprintf(`!meta {"timemap_uri": {"link_format": "%s/timemap/link/%s", "json_format": "%s/timemap/json/%s", "cdxj_format": "%s/timemap/cdxj/%s"}}`+"\n", *proxy, urir, *proxy, urir, *proxy, urir)
347
-
348
341
i := 0
349
342
type Memento struct {
350
343
Urim string
@@ -367,8 +360,6 @@ func generateSummary(urir string, basetm *list.List, format string, dataCh chan
367
360
rels = strings .Join (lnk .NavRels , " " ) + " " + rels
368
361
}
369
362
i += 1
370
- dataCh <- fmt .Sprintf (`%d` + "\n " , i )
371
-
372
363
// NOTE that the temporally first for an archive is likely not the first memento in the whole TimeMap
373
364
hostbuck := strings .SplitN (lnk .Href , "/" , 4 )
374
365
archive , exists := archives [hostbuck [2 ]]
@@ -397,28 +388,26 @@ func generateSummary(urir string, basetm *list.List, format string, dataCh chan
397
388
newarchive := Archive {memento , memento , 1 }
398
389
archives [hostbuck [2 ]] = newarchive
399
390
}
400
- dataCh <- fmt .Sprintf (`%s %s` + "\n " , lnk .Timeobj .Format (time .RFC3339 ), lnk .Href )
401
- //dataCh <- fmt.Sprintf(`%s {"uri": "%s", "rel": "%s", "datetime": "%s"}`+"\n", lnk.Timestr, lnk.Href, rels, lnk.Datetime)
402
391
}
392
+ dataCh <- fmt .Sprintf ("{\n " + ` "original_uri": "%s",` + "\n " , urir )
403
393
// Count total mementos in all archives
404
394
mcount := 0
405
- dataCh <- fmt .Sprintf (`"archives": {` + "\n " )
395
+ dataCh <- fmt .Sprintf (` "archives": {` + "\n " )
406
396
for host , archive := range archives {
407
397
mcount += archive .Count
408
- dataCh <- fmt .Sprintf (` "%s":{` + "\n " , host )
409
- dataCh <- fmt .Sprintf (` "count": %d,"` + "\n " , archive .Count )
410
- dataCh <- fmt .Sprintf (` "first":{` + "\n " )
411
- dataCh <- fmt .Sprintf (` "datetime": %d,` + "\n " , archive .First .Datetime )
412
- dataCh <- fmt .Sprintf (` "uri": "%s",` + "\n }\n " , archive .First .Urim )
413
- dataCh <- fmt .Sprintf (` "last":{` + "\n " )
414
- dataCh <- fmt .Sprintf (` "datetime": %d,` + "\n " , archive .Last .Datetime )
415
- dataCh <- fmt .Sprintf (` "uri": "%s",` + "\n }\n " , archive .Last .Urim )
398
+ dataCh <- fmt .Sprintf (` "%s":{` + "\n " , host )
399
+ dataCh <- fmt .Sprintf (` "count": %d,"` + "\n " , archive .Count )
400
+ dataCh <- fmt .Sprintf (` "first":{` + "\n " )
401
+ dataCh <- fmt .Sprintf (` "datetime": %d,` + "\n " , archive .First .Datetime )
402
+ dataCh <- fmt .Sprintf (` "uri": "%s",` + "\n }\n " , archive .First .Urim )
403
+ dataCh <- fmt .Sprintf (` "last":{` + "\n " )
404
+ dataCh <- fmt .Sprintf (` "datetime": %d,` + "\n " , archive .Last .Datetime )
405
+ dataCh <- fmt .Sprintf (` "uri": "%s",` + "\n }\n " , archive .Last .Urim )
416
406
dataCh <- fmt .Sprintf (" },\n " )
417
407
}
418
- dataCh <- fmt .Sprintf (`"total_mementos": %d` , mcount )
419
- fmt . Printf ( "Total memento count: %d \n " , mcount )
408
+ dataCh <- fmt .Sprintf (` "total_mementos": %d` + " \n " , mcount )
409
+ // Echo out server-side for debugging
420
410
fmt .Println (archives )
421
-
422
411
}
423
412
424
413
func serializeLinks (urir string , basetm * list.List , format string , dataCh chan string , navonly bool , sess * Session ) {
0 commit comments