This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
arbit.go
774 lines (688 loc) · 18.2 KB
/
arbit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
package main
import (
"fmt"
"log"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
"github.com/mtgban/go-mtgban/mtgban"
"golang.org/x/exp/slices"
)
const (
MaxArbitResults = 450
MaxPriceRatio = 120.0
MaxSpread = 650.0
MinSpread = 10.0
MaxSpreadGlobal = 1000
MinSpreadGlobal = 200.0
MaxResultsGlobal = 300
MaxResultsGlobalLimit = 50
MinSpreadNegative = -30
MinDiffNegative = -100
MinSpreadHighYield = 100
MinSpreadHighYieldGlobal = 350
)
var FilteredEditions = []string{
"Collectors’ Edition",
"Foreign Black Border",
"Foreign White Border",
"Intl. Collectors’ Edition",
"Limited Edition Alpha",
"Limited Edition Beta",
"Unlimited Edition",
"Legends Italian",
"The Dark Italian",
"Rinascimento",
"Chronicles Japanese",
"Foreign Black Border",
"Fourth Edition Black Border",
}
// Every single boolean option
var FilterOptKeys = []string{
"credit",
"nocond",
"nofoil",
"onlyfoil",
"nocomm",
"nononrl",
"nononabu4h",
"onlyshiny",
"noposi",
"nopenny",
"nobuypenny",
"nolow",
"nodiff",
"nodiffplus",
"noqty",
"norand",
}
type FilterOpt struct {
Title string
Func func(*mtgban.ArbitOpts)
ArbitOnly bool
BetaFlag bool
NoSealed bool
SealedOnly bool
}
// User-readable option name and associated function/visibility option
var FilterOptConfig = map[string]FilterOpt{
"nocond": {
Title: "only NM/SP",
Func: func(opts *mtgban.ArbitOpts) {
opts.Conditions = BadConditions
},
NoSealed: true,
},
"nofoil": {
Title: "only non-Foil",
Func: func(opts *mtgban.ArbitOpts) {
opts.NoFoil = true
},
NoSealed: true,
},
"onlyfoil": {
Title: "only Foil",
Func: func(opts *mtgban.ArbitOpts) {
opts.OnlyFoil = true
},
NoSealed: true,
},
"nocomm": {
Title: "only Rare/Mythic",
Func: func(opts *mtgban.ArbitOpts) {
opts.Rarities = UCRarity
},
NoSealed: true,
},
"nononrl": {
Title: "only RL",
Func: func(opts *mtgban.ArbitOpts) {
opts.OnlyReserveList = true
},
BetaFlag: true,
NoSealed: true,
},
"nononabu4h": {
Title: "only ABU4H",
Func: func(opts *mtgban.ArbitOpts) {
opts.OnlyEditions = ABU4H
},
ArbitOnly: true,
BetaFlag: true,
NoSealed: true,
},
"onlyshiny": {
Title: "only Shinies",
Func: func(opts *mtgban.ArbitOpts) {
opts.OnlyEditions = ShinyEditions
opts.OnlyCollectorNumberRanges = ShinyEditionRanges
},
BetaFlag: true,
NoSealed: true,
},
"noposi": {
Title: "only Negative",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinSpread = MinSpreadNegative
opts.MinDiff = MinDiffNegative
opts.MaxSpread = MinSpread
},
ArbitOnly: true,
NoSealed: true,
},
"nopenny": {
Title: "only Bucks+",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinPrice = 1
},
NoSealed: true,
},
"nobuypenny": {
Title: "only BuyBucks+",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinBuyPrice = 1
},
ArbitOnly: true,
NoSealed: true,
},
"nolow": {
Title: "only Yield+",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinSpread = MinSpreadHighYield
},
},
"nodiff": {
Title: "only Difference+",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinDiff = 1
},
},
"nodiffplus": {
Title: "only Difference++",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinDiff = 5
},
},
"noqty": {
Title: "only Quantity+",
Func: func(opts *mtgban.ArbitOpts) {
opts.MinQuantity = 1
},
ArbitOnly: true,
},
"norand": {
Title: "only Decklists+",
Func: func(opts *mtgban.ArbitOpts) {
opts.SealedDecklist = true
},
SealedOnly: true,
},
}
var BadConditions = []string{"MP", "HP", "PO"}
var UCRarity = []string{"uncommon", "common"}
var ABU4H = []string{
"Limited Edition Alpha",
"Limited Edition Beta",
"Unlimited Edition",
"Arabian Nights",
"Antiquities",
"Legends",
"The Dark",
}
var ShinyEditions = []string{
"Seventh Edition",
"Zendikar Expeditions",
"Kaladesh Inventions",
"Amonkhet Invocations",
"Mythic Edition",
"Ultimate Box Topper",
"Secret Lair Drop",
"Zendikar Rising Expeditions",
"Modern Horizons 1 Timeshifts",
// Filtered below
"Ikoria: Lair of Behemoths",
"Commander Legends",
"Double Masters",
"Time Spiral Remastered",
"Strixhaven Mystical Archive",
}
var ShinyEditionRanges = map[string][2]int{
// Godzilla series
"Ikoria: Lair of Behemoths": {370, 387},
// Etched commanders
"Commander Legends": {514, 614},
// Box toppers
"Double Masters": {333, 372},
// Timeshifts
"Time Spiral Remastered": {290, 411},
// JPN cards
"Strixhaven Mystical Archive": {64, 126},
}
type Arbitrage struct {
Name string
Key string
Arbit []mtgban.ArbitEntry
HasCredit bool
HasNoQty bool
HasNoConds bool
}
func Arbit(w http.ResponseWriter, r *http.Request) {
arbit(w, r, false)
}
func Reverse(w http.ResponseWriter, r *http.Request) {
arbit(w, r, true)
}
func arbit(w http.ResponseWriter, r *http.Request, reverse bool) {
sig := getSignatureFromCookies(r)
pageName := "Arbitrage"
if reverse {
pageName = "Reverse"
}
pageVars := genPageNav(pageName, sig)
var anyOptionEnabled bool
var allowlistSellers []string
allowlistSellersOpt := GetParamFromSig(sig, "ArbitEnabled")
if allowlistSellersOpt == "ALL" || (DevMode && !SigCheck) {
for _, seller := range Sellers {
if seller == nil || seller.Info().MetadataOnly {
continue
}
allowlistSellers = append(allowlistSellers, seller.Info().Shorthand)
}
// Enable any option with BetaFlag
anyOptionEnabled = true
} else if allowlistSellersOpt == "DEV" {
allowlistSellers = append(Config.ArbitDefaultSellers, Config.DevSellers...)
} else if allowlistSellersOpt == "" {
allowlistSellers = Config.ArbitDefaultSellers
} else {
allowlistSellers = strings.Split(allowlistSellersOpt, ",")
}
var blocklistVendors []string
blocklistVendorsOpt := GetParamFromSig(sig, "ArbitDisabledVendors")
if blocklistVendorsOpt == "" {
blocklistVendors = Config.ArbitBlockVendors
} else if blocklistVendorsOpt != "NONE" {
blocklistVendors = strings.Split(blocklistVendorsOpt, ",")
}
if r.FormValue("page") == "opt" {
// Load all available vendors
vendorKeys := make([]string, 0, len(blocklistVendors))
for _, vendor := range Vendors {
if vendor == nil || slices.Contains(blocklistVendors, vendor.Info().Shorthand) {
continue
}
vendorKeys = append(vendorKeys, vendor.Info().Shorthand)
}
sort.Slice(vendorKeys, func(i, j int) bool {
return ScraperNames[vendorKeys[i]] < ScraperNames[vendorKeys[j]]
})
pageVars.VendorKeys = vendorKeys
} else {
filters := strings.Split(readCookie(r, "ArbitVendorsList"), ",")
for _, code := range filters {
if !slices.Contains(blocklistVendors, code) {
blocklistVendors = append(blocklistVendors, code)
}
}
}
pageVars.ReverseMode = reverse
start := time.Now()
scraperCompare(w, r, pageVars, allowlistSellers, blocklistVendors, true, anyOptionEnabled)
user := GetParamFromSig(sig, "UserEmail")
msg := fmt.Sprintf("Request by %s took %v", user, time.Since(start))
UserNotify("arbit", msg)
LogPages["Arbit"].Println(msg)
}
func Global(w http.ResponseWriter, r *http.Request) {
sig := getSignatureFromCookies(r)
pageVars := genPageNav("Global", sig)
anyEnabledOpt := GetParamFromSig(sig, "AnyEnabled")
anyEnabled, _ := strconv.ParseBool(anyEnabledOpt)
anyExperimentOpt := GetParamFromSig(sig, "AnyExperimentsEnabled")
anyExperiment, _ := strconv.ParseBool(anyExperimentOpt)
anyEnabled = anyEnabled || (DevMode && !SigCheck)
anyExperiment = anyExperiment || (DevMode && !SigCheck)
// The "menu" section, the reference
var allowlistSellers []string
for _, seller := range Sellers {
if seller == nil {
continue
}
if anyEnabled {
// This is the list of allowed global sellers, minus the ones blocked from search
if slices.Contains(Config.GlobalAllowList, seller.Info().Shorthand) {
if !anyExperiment && slices.Contains(Config.SearchRetailBlockList, seller.Info().Shorthand) {
continue
}
allowlistSellers = append(allowlistSellers, seller.Info().Shorthand)
} else if anyExperiment && slices.Contains(Config.DevSellers, seller.Info().Shorthand) {
// Append any experimental ones if enabled
allowlistSellers = append(allowlistSellers, seller.Info().Shorthand)
}
} else {
// These are hardcoded to provide a preview of the tool
if seller.Info().Shorthand != TCG_MARKET &&
seller.Info().Shorthand != MKM_TREND {
continue
}
allowlistSellers = append(allowlistSellers, seller.Info().Shorthand)
}
}
// The "Jump to" section, the probe
var blocklistVendors []string
for _, seller := range Sellers {
if seller == nil {
continue
}
if slices.Contains(Config.GlobalProbeList, seller.Info().Shorthand) {
continue
}
blocklistVendors = append(blocklistVendors, seller.Info().Shorthand)
}
// Inform the render this is Global
pageVars.GlobalMode = true
start := time.Now()
scraperCompare(w, r, pageVars, allowlistSellers, blocklistVendors, anyEnabled)
user := GetParamFromSig(sig, "UserEmail")
msg := fmt.Sprintf("Request by %s took %v", user, time.Since(start))
UserNotify("global", msg)
LogPages["Global"].Println(msg)
}
func scraperCompare(w http.ResponseWriter, r *http.Request, pageVars PageVars, allowlistSellers []string, blocklistVendors []string, flags ...bool) {
r.ParseForm()
var source mtgban.Scraper
var message string
var sorting string
arbitFilters := map[string]bool{}
limitedResults := len(flags) > 0 && !flags[0]
anyOptionEnabled := len(flags) > 1 && flags[1]
pageVars.CanShowAll = anyOptionEnabled
// Set these flags for global, since it's likely users will want them
if pageVars.GlobalMode {
arbitFilters["nopenny"] = !arbitFilters["nopenny"]
arbitFilters["nodiff"] = !arbitFilters["nodiff"]
}
for k, v := range r.Form {
switch k {
case "source":
// Source can be a Seller or Vendor depending on operation mode
if pageVars.ReverseMode {
if slices.Contains(blocklistVendors, v[0]) {
log.Println("Unauthorized attempt with", v[0])
message = "Unknown " + v[0] + " seller"
break
}
for _, vendor := range Vendors {
if vendor == nil {
continue
}
if vendor.Info().Shorthand == v[0] {
source = vendor
break
}
}
} else {
if !slices.Contains(allowlistSellers, v[0]) {
log.Println("Unauthorized attempt with", v[0])
message = "Unknown " + v[0] + " seller"
break
}
for _, seller := range Sellers {
if seller == nil {
continue
}
if seller.Info().Shorthand == v[0] {
source = seller
break
}
}
}
if source == nil {
message = "Unknown " + v[0] + " source"
}
case "sort":
sorting = v[0]
// Assume anything else is a boolean option
default:
// Skip options reserved for arbit-only
if pageVars.GlobalMode && FilterOptConfig[k].ArbitOnly {
continue
}
// Skip experimental options
if !anyOptionEnabled && FilterOptConfig[k].BetaFlag {
continue
}
// Skip sealed options when on sealed
if source != nil && source.Info().SealedMode && FilterOptConfig[k].NoSealed {
continue
}
if source != nil && !source.Info().SealedMode && FilterOptConfig[k].SealedOnly {
continue
}
arbitFilters[k], _ = strconv.ParseBool(v[0])
}
}
if message != "" {
pageVars.Title = "Errors have been made"
pageVars.ErrorMessage = message
render(w, "arbit.html", pageVars)
return
}
// Set up menu bar, by selecting which scrapers should be selectable as source
var menuScrapers []mtgban.Scraper
if pageVars.ReverseMode {
for _, vendor := range Vendors {
if vendor == nil || slices.Contains(blocklistVendors, vendor.Info().Shorthand) {
continue
}
menuScrapers = append(menuScrapers, vendor)
}
} else {
for _, seller := range Sellers {
if seller == nil || !slices.Contains(allowlistSellers, seller.Info().Shorthand) {
continue
}
menuScrapers = append(menuScrapers, seller)
}
}
// Populate the menu bar with the pool selected above
for _, scraper := range menuScrapers {
var link string
if pageVars.GlobalMode {
link = "/global"
} else {
link = "/arbit"
if pageVars.ReverseMode {
link = "/reverse"
}
}
nav := NavElem{
Name: scraper.Info().Name,
Short: scraper.Info().Shorthand,
Link: link,
}
if scraper.Info().SealedMode && !strings.Contains(nav.Name, "Sealed") {
nav.Name += " Sealed"
}
v := url.Values{}
v.Set("source", scraper.Info().Shorthand)
for key, val := range arbitFilters {
v.Set(key, fmt.Sprint(val))
}
v.Set("sort", fmt.Sprint(sorting))
nav.Link += "?" + v.Encode()
if source != nil && source.Info().Shorthand == scraper.Info().Shorthand {
nav.Active = true
nav.Class = "selected"
}
pageVars.ExtraNav = append(pageVars.ExtraNav, nav)
}
if source == nil {
if limitedResults {
pageVars.InfoMessage = "Increase your tier to discover more cards and more markets!"
}
render(w, "arbit.html", pageVars)
return
}
pageVars.IsSealed = source.Info().SealedMode
pageVars.ScraperShort = source.Info().Shorthand
pageVars.HasAffiliate = slices.Contains(Config.AffiliatesList, source.Info().Shorthand)
pageVars.ArbitFilters = arbitFilters
pageVars.ArbitOptKeys = FilterOptKeys
pageVars.ArbitOptConfig = FilterOptConfig
pageVars.Arb = []Arbitrage{}
pageVars.Metadata = map[string]GenericCard{}
opts := &mtgban.ArbitOpts{
MinSpread: MinSpread,
MaxSpread: MaxSpread,
MaxPriceRatio: MaxPriceRatio,
}
// Set options
for _, key := range FilterOptKeys {
isSet := arbitFilters[key]
_, hasFunc := FilterOptConfig[key]
if isSet && hasFunc {
FilterOptConfig[key].Func(opts)
}
}
// Customize opts for Globals
if pageVars.GlobalMode {
opts.MinSpread = MinSpreadGlobal
opts.MaxSpread = MaxSpreadGlobal
if arbitFilters["nolow"] {
opts.MinSpread = MinSpreadHighYieldGlobal
}
if arbitFilters["nodiff"] {
opts.MinDiff = 5
}
if arbitFilters["nodiffplus"] {
opts.MinDiff = 10
}
opts.Editions = FilteredEditions
}
if source.Info().SealedMode {
opts.MinSpread = MinSpreadNegative
opts.MinDiff = MinDiffNegative
}
// The pool of scrapers that source will be compared against
var scrapers []mtgban.Scraper
if pageVars.GlobalMode || pageVars.ReverseMode {
for _, seller := range Sellers {
if seller == nil {
continue
}
// Skip unactionable sellers
if seller.Info().SealedMode && seller.Info().MetadataOnly {
continue
}
scrapers = append(scrapers, seller)
}
} else {
for _, vendor := range Vendors {
if vendor == nil {
continue
}
scrapers = append(scrapers, vendor)
}
}
for _, scraper := range scrapers {
if scraper.Info().Shorthand == source.Info().Shorthand {
continue
}
if !pageVars.ReverseMode {
if slices.Contains(blocklistVendors, scraper.Info().Shorthand) {
continue
}
}
// Set custom scraper options
if pageVars.GlobalMode && scraper.Info().Shorthand == TCG_DIRECT {
opts.Conditions = BadConditions
}
if scraper.Info().Shorthand == "ABU" {
opts.UseTrades = arbitFilters["credit"]
}
var arbit []mtgban.ArbitEntry
var err error
if pageVars.GlobalMode {
arbit, err = mtgban.Mismatch(opts, scraper.(mtgban.Seller), source.(mtgban.Seller))
} else if pageVars.ReverseMode {
arbit, err = mtgban.Arbit(opts, source.(mtgban.Vendor), scraper.(mtgban.Seller))
} else {
arbit, err = mtgban.Arbit(opts, scraper.(mtgban.Vendor), source.(mtgban.Seller))
}
if err != nil {
log.Println(err)
continue
}
if len(arbit) == 0 {
continue
}
// For Global, drop results before sorting, to add some extra variance
if pageVars.GlobalMode {
maxResults := MaxResultsGlobal
// Lower max number of results for the preview
if limitedResults {
maxResults = MaxResultsGlobalLimit
}
if len(arbit) > maxResults {
arbit = arbit[:maxResults]
}
}
// Sort as requested
switch sorting {
case "available":
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].InventoryEntry.Quantity > arbit[j].InventoryEntry.Quantity
})
case "sell_price":
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].InventoryEntry.Price > arbit[j].InventoryEntry.Price
})
case "buy_price":
if pageVars.GlobalMode {
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].ReferenceEntry.Price > arbit[j].ReferenceEntry.Price
})
} else {
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].BuylistEntry.BuyPrice > arbit[j].BuylistEntry.BuyPrice
})
}
case "trade_price":
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].BuylistEntry.TradePrice > arbit[j].BuylistEntry.TradePrice
})
case "diff":
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].Difference > arbit[j].Difference
})
default:
sort.Slice(arbit, func(i, j int) bool {
return arbit[i].Spread > arbit[j].Spread
})
}
pageVars.SortOption = sorting
// For Arbit, drop any excessive results after sorting
if !pageVars.GlobalMode && len(arbit) > MaxArbitResults {
arbit = arbit[:MaxArbitResults]
}
name := scraper.Info().Name
switch name {
case "TCG Player Market":
name = "TCG Player Trade-In"
case "Sealed EV Scraper":
name = "Card Kingdom Singles Buylist"
}
entry := Arbitrage{
Name: name,
Key: scraper.Info().Shorthand,
Arbit: arbit,
HasCredit: !scraper.Info().NoCredit,
HasNoQty: scraper.Info().MetadataOnly || scraper.Info().NoQuantityInventory,
}
if pageVars.GlobalMode {
entry.HasCredit = false
entry.HasNoConds = source.Info().MetadataOnly
}
if source.Info().SealedMode {
entry.HasNoConds = scraper.Info().MetadataOnly
}
pageVars.Arb = append(pageVars.Arb, entry)
for i := range arbit {
cardId := arbit[i].CardId
_, found := pageVars.Metadata[cardId]
if found {
continue
}
pageVars.Metadata[cardId] = uuid2card(cardId, true)
if pageVars.Metadata[cardId].Reserved {
pageVars.HasReserved = true
}
if pageVars.Metadata[cardId].Stocks {
pageVars.HasStocks = true
}
if pageVars.Metadata[cardId].SypList {
pageVars.HasSypList = true
}
}
}
if len(pageVars.Arb) == 0 {
pageVars.InfoMessage = "No arbitrage available!"
}
if pageVars.GlobalMode {
pageVars.Title = "Market Imbalance in " + source.Info().Name
} else {
pageVars.Title = "Arbitrage"
if pageVars.ReverseMode {
pageVars.Title += " towards "
} else {
pageVars.Title += " from "
}
pageVars.Title += source.Info().Name
}
render(w, "arbit.html", pageVars)
}