pdgzf

package module
v0.0.0-...-82c0af8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

pdgzf

https://select.pdgzf.com

  • 浦东公租房 REST API 封装,可用于一些自动化脚本,或数据分析使用
  • 数据结构定义不全,仅用于本人的个人脚本,欢迎提 pr 补全
  • 验证码识别推荐使用ttshitu,便宜好用(本人亲测非广告)

房源镜像

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoginArgs

func GetLoginArgs(logReqStrFmt string, cr CaptchaRecognize) (logReqStr string, jSessionID string, err error)

生成登陆参数 logReqStrFmt 登录请求消息体,预留验证码字段占位 {"account":"xxx","password":"xxxx","captcha":"%s"} cr 验证码识别方法

func Login

func Login(loginReqStr, jSessionID string) (cookies []*http.Cookie, err error)

Login 登陆验证码不好破...这里直接复制登陆请求(一个漏洞) loginReqStr是login的body {"account":"xxx","password":"xxxx","captcha":"xxx"} JSESSIONID从cookie中找

Types

type CaptchaRecognize

type CaptchaRecognize func(imageBase64 string) (result string, err error)

验证码识别方法...目前没有好的方法,可以自行训练,或者网上有部分识别API尚可 推荐使用[ttshitu](http://www.ttshitu.com/),便宜好用

type House

type House struct {
	ID              int64   `json:"id"`
	FullName        string  `json:"fullName"`
	TypeName        int     `json:"typeName"`
	Queue           []Queue `json:"queue"`
	QueueCount      int     `json:"queueCount"`
	SelectStartTime string  `json:"selectStartTime"`
}

House 房源信息

func GetHouses

func GetHouses(reqStr string, cookies []*http.Cookie) []*House

GetHouses 根据请求查询房源列表 reqStr https://select.pdgzf.com/houseLists 页面定制查询条件,复制POST参数JSON字符串 cookies 从Login中拿,也可以自己从header中取GZFAuthentication(有效期24h),存入http.Cookie结构中 如果无需排队数据,cookies参数填空即可

type Period

type Period struct {
	Name      string `json:"name"`
	StartTime string `json:"startTime"`
}

type Queue

type Queue struct {
	Qualification QueueItem `json:"qualification"`
	Status        string    `json:"status"`
	Position      int       `json:"position"`
	Period        Period    `json:"period"`
}

type QueueItem

type QueueItem struct {
	Code      string `json:"code"`
	Name      string `json:"name"`
	StartDate string `json:"startDate"`
}

QueueItem 排队信息

func GetQueue

func GetQueue(houseID int, cookies []*http.Cookie) []*QueueItem

GetQueue 获取房源排队队列 houseID 房源ID cookies 从Login中拿,也可以自己从header中取GZFAuthentication(有效期24h) 如果无需排队数据,cookies参数填空即可

Jump to

Keyboard shortcuts

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