Documentation ¶
Index ¶
Constants ¶
View Source
const BASE_URL = "http://web.smsbus.cl/web/buscarAction.do"
View Source
const BUS_DISTANCE_SELECTOR = "#distancia_respuesta_solo_paradero, #proximo_distancia_respuesta"
View Source
const BUS_ID_SELECTOR = "#bus_respuesta_solo_paradero, #proximo_bus_respuesta"
View Source
const BUS_SERVICE_SELECTOR = "#servicio_respuesta_solo_paradero"
View Source
const BUS_TIME_SELECTOR = "#tiempo_respuesta_solo_paradero, #proximo_tiempo_respuesta"
View Source
const SERVICE_ERROR_DESCRIPTION_SELECTOR = "#respuesta_error_solo_paradero"
View Source
const SERVICE_ERROR_SELECTOR = "#servicio_error_solo_paradero"
View Source
const SERVICE_OK_SELECTOR = "#proximo_solo_paradero, #siguiente_respuesta"
View Source
const SESSION_URL = BASE_URL + "?d=cargarServicios"
View Source
const SINGLE_SERVICE_ERROR_SELECTOR = "#respuesta_error"
View Source
const SINGLE_SERVICE_OK_SELECTOR = "#proximo_respuesta"
View Source
const STOP_ERROR = "#respuesta_error"
Data Selector Constants
View Source
const STOP_ID_SELECTOR = "#numero_parada_respuesta .texto_h2"
View Source
const STOP_NAME_SELECTOR = "#nombre_paradero_respuesta"
Variables ¶
View Source
var Errors = map[ErrorCode]string{
0: "Itinerario obtenido satisfactoriamente",
10: "Error indeterminado al interpretar parámetro ID de Parada",
11: "Parámetro ID de Parada faltante",
12: "Parámetro ID de Parada mal formado",
20: "Error indeterminado al parsear información desde SMSBus",
21: "SMSBus no contesta",
22: "SMSBus contesta, pero no entrega información interpretable",
23: "Imposible interpretar valores de itinerario",
30: "Error indeterminado con paradero",
}
View Source
var MenosRegex = regexp.MustCompile("[Mm]enos")
View Source
var TimeRegex = regexp.MustCompile("[0-9]{1,2}")
Functions ¶
This section is empty.
Types ¶
type BusResponse ¶
type Parser ¶
func (*Parser) GetCronTasks ¶
func (*Parser) StartParser ¶
func (bp *Parser) StartParser()
func (*Parser) StopParser ¶
func (bp *Parser) StopParser()
type Response ¶
type Response struct { ID string `json:"id"` Name string `json:"name"` StatusCode ErrorCode `json:"status_code"` StatusDescription string `json:"status_description"` Services []*ServiceResponse `json:"services"` }
type ServiceResponse ¶
type ServiceResponse struct { ID string `json:"id"` Valid bool `json:"valid"` StatusDescription string `json:"status_description"` Buses []*BusResponse `json:"buses"` }
Click to show internal directories.
Click to hide internal directories.