VoxelPrismatic / dwlibrary

The DW Library
http://thesweetbabygang.com
1 stars 0 forks source link

Election graph #3

Open VoxelPrismatic opened 1 day ago

VoxelPrismatic commented 1 day ago

Pull live ballot counts from https://realclearpolitics.com for the purpose of creating a ballot count graph to expose potential fraud, like Wisconsin 2024. 20241113_073355.jpg 20241113_073234.jpg

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.

VoxelPrismatic commented 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
}