sccrawler

package module
v0.0.0-...-803748d Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 15 Imported by: 0

README

spaceCloudCrawler

This is for Space Cloud Hosts.

Expect Workflow:

  1. Crawling reservations of Space Cloud as HTML
  2. Parsing reservations to store into DB
  3. Sending SMS to the reserved users

Requirements & Test spec:

  • GCP e2-micro
  • Go 1.17
  • Sqlite3 3.37
  • Chrome

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChromedpTest

func ChromedpTest(email, pw string)

func Get

func Get(db *sql.DB, query string, key string) map[string]map[string]string

Query database Result : arr[pk][column]string

func OpenDB

func OpenDB(file string) (*sql.DB, error)

func OpenMysql

func OpenMysql(username, pw, ip, port, dbname string) *sql.DB

func RemoveBlanks

func RemoveBlanks(text string) (result string)

func Save

func Save(db *sql.DB, query string)

Query database No return data. Use for [insert, delete, update]

func SaveMysql

func SaveMysql(db *sql.DB, query string)

func SelectMysql

func SelectMysql(db *sql.DB, query string, key string) map[string]map[string]string

func SelectMysqlTest

func SelectMysqlTest(db *sql.DB, query string, key string) map[string]map[string]string

func Start

func Start(email, pw, pageNum string, c chan<- string, channum int)

Run crwaler to get SC reservations

func Timestamp

func Timestamp() string

Types

type AligoApiData

type AligoApiData struct {
	Key         string `json:"key"`         // **인증용 API Key
	User_id     string `json:"user_id"`     // **사용자 id
	Sender      string `json:"sender"`      // **발신자 전화번호 (최대 16bytes)
	Receiver    string `json:"receiver"`    // **수신자 전화번호 - 컴마(,)분기 입력으로 최대 1천명
	Msg         string `json:"msg"`         // **메세지 내용
	Msg_type    string `json:"msg_type"`    // SMS(단문) , LMS(장문), MMS(그림문자) 구분
	Title       string `json:"title"`       // 문자제목(LMS,MMS만 허용)
	Destination string `json:"destination"` // %고객명% 치환용 입력
	Rdate       string `json:"rdate"`       // 예약일 (현재일이상)
	Rtime       string `json:"rtime"`       // 예약시간 - 현재시간기준 10분이후
	Testmode_yn string `json:"testmode_yn"` // 연동테스트시 Y 적용
}

func NewApiData

func NewApiData() AligoApiData

Instantiation Aligo SMS data

type AligoResponse

type AligoResponse struct {
	Result_code string `json:"result_code"`
	Message     string `json:"message"`
}

func NewResponseData

func NewResponseData() AligoResponse

Instantiation Aligo SMS response

func Send

func Send(data *AligoApiData) AligoResponse

Send SMS via Aligo

type Reservation

type Reservation struct {
	Id    string
	Name  string
	Tel   string
	Place string
	Date  string
}

func NewObject

func NewObject() []Reservation

Instantiation SC reservation

func ParseHtml

func ParseHtml(html string) (result []Reservation)

Parse SC website HTML Return reservation struct

Jump to

Keyboard shortcuts

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