cmpscraper

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

README

CMP Scraper

This is a simple package used to scrape the Central Maine Power website for outage information.

Usage

package main

import (
	"log"
	"net/http"

	"github.com/HelixSpiral/cmpscraper"
)

func main() {
	httpClient := &http.Client{}

	stats, _ := cmpscraper.GetStats(httpClient)
	log.Printf("%+v", stats)
}

Documentation

Index

Constants

View Source
const URL = "https://ecmp.cmpco.com/OutageReports/CMP.html"

Variables

This section is empty.

Functions

This section is empty.

Types

type CMP

type CMP struct {
	LastUpdate   time.Time
	Total        string
	WithoutPower string
	Counties     map[string]Outage
	NoOutages    bool
}

func GetStats

func GetStats(httpClient *http.Client) (CMP, error)

type Outage

type Outage struct {
	Total        string
	WithoutPower string
}

Directories

Path Synopsis
Examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL