Open VoxelPrismatic opened 1 day ago
type ElectionRace struct {
ID string `gorm:"primaryKey"` // eg 2024-P-IL-GOP
Year int
State string
County string // "District #" if applicable
Party string // GOP, DEM, WRT, etc
Race string // President, House, Senate, Governor, Mayor, etc
Color string // Hex color
}
type ElectionSnapshot struct {
Race string `gorm:"primaryKey"`
Timestamp int64 `gorm:"primaryKey;autoIncrement=false"` // X-axis
Called bool // Will darken graph after this point
BallotCount int // Y-axis
ReportingPct int // Clarity
}
type (race ElectionRace) Snapshots() []ElectionSnapshot {
ret := []ElectionSnapshot{}
db.Where(&ElectionSnapshot{ Race: race.ID }).Order("timestamp ASC"). Find(&ret)
return ret
}
Pull live ballot counts from https://realclearpolitics.com for the purpose of creating a ballot count graph to expose potential fraud, like Wisconsin 2024.
This way, I can trust these graphs without any reliance on other people, and I will always have a reference to these graphs for any future purpose.