Documentation
¶
Index ¶
- Variables
- func FetchGoogle(conf *Config, results map[int]*Result) error
- func FetchOpenSerp(conf *Config, results map[int]*Result) error
- func FetchStackOverflow(conf *Config, results map[int]*Result) error
- func GetAnswers(conf *Config, fetchResults func(*Config, map[int]*Result) error, ...) (string, error)
- type Answer
- type Config
- type GoogleSearchResult
- type OpenSerpResult
- type Result
- type StackOverflowQuestion
- type StackOverflowResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string = "v0.0.4"
Functions ¶
func FetchOpenSerp ¶ added in v0.0.2
Types ¶
type Answer ¶
type GoogleSearchResult ¶
type GoogleSearchResult struct {
Kind string `json:"kind"`
URL struct {
Type string `json:"type"`
Template string `json:"template"`
} `json:"url"`
Queries struct {
Request []struct {
Title string `json:"title"`
TotalResults string `json:"totalResults"`
SearchTerms string `json:"searchTerms"`
Count int `json:"count"`
StartIndex int `json:"startIndex"`
InputEncoding string `json:"inputEncoding"`
OutputEncoding string `json:"outputEncoding"`
Safe string `json:"safe"`
Cx string `json:"cx"`
} `json:"request"`
NextPage []struct {
Title string `json:"title"`
TotalResults string `json:"totalResults"`
SearchTerms string `json:"searchTerms"`
Count int `json:"count"`
StartIndex int `json:"startIndex"`
InputEncoding string `json:"inputEncoding"`
OutputEncoding string `json:"outputEncoding"`
Safe string `json:"safe"`
Cx string `json:"cx"`
} `json:"nextPage"`
} `json:"queries"`
Context struct {
Title string `json:"title"`
} `json:"context"`
SearchInformation struct {
SearchTime float64 `json:"searchTime"`
FormattedSearchTime string `json:"formattedSearchTime"`
TotalResults string `json:"totalResults"`
FormattedTotalResults string `json:"formattedTotalResults"`
} `json:"searchInformation"`
Items []struct {
Kind string `json:"kind"`
Title string `json:"title"`
HTMLTitle string `json:"htmlTitle"`
Link string `json:"link"`
DisplayLink string `json:"displayLink"`
Snippet string `json:"snippet"`
HTMLSnippet string `json:"htmlSnippet"`
FormattedURL string `json:"formattedUrl"`
HTMLFormattedURL string `json:"htmlFormattedUrl"`
Pagemap struct {
CseThumbnail []struct {
Src string `json:"src"`
Width string `json:"width"`
Height string `json:"height"`
} `json:"cse_thumbnail"`
Qapage []struct {
Image string `json:"image"`
Primaryimageofpage string `json:"primaryimageofpage"`
Name string `json:"name"`
Description string `json:"description"`
} `json:"qapage"`
Question []struct {
Image string `json:"image"`
Upvotecount string `json:"upvotecount"`
Answercount string `json:"answercount"`
Name string `json:"name"`
Datecreated string `json:"datecreated"`
Text string `json:"text"`
URL string `json:"url"`
} `json:"question"`
Answer []struct {
Upvotecount string `json:"upvotecount"`
Commentcount string `json:"commentcount,omitempty"`
Text string `json:"text"`
Datecreated string `json:"datecreated"`
URL string `json:"url"`
} `json:"answer"`
Person []struct {
Name string `json:"name"`
} `json:"person"`
Metatags []struct {
OgImage string `json:"og:image"`
OgType string `json:"og:type"`
TwitterCard string `json:"twitter:card"`
TwitterTitle string `json:"twitter:title"`
OgSiteName string `json:"og:site_name"`
TwitterDomain string `json:"twitter:domain"`
Viewport string `json:"viewport"`
TwitterDescription string `json:"twitter:description"`
Bingbot string `json:"bingbot"`
OgURL string `json:"og:url"`
} `json:"metatags"`
CseImage []struct {
Src string `json:"src"`
} `json:"cse_image"`
} `json:"pagemap"`
} `json:"items"`
}
type OpenSerpResult ¶ added in v0.0.2
type Result ¶
type StackOverflowQuestion ¶ added in v0.0.4
type StackOverflowQuestion struct {
Items []struct {
Tags []string `json:"tags"`
Owner struct {
AccountID int `json:"account_id"`
Reputation int `json:"reputation"`
UserID int `json:"user_id"`
UserType string `json:"user_type"`
ProfileImage string `json:"profile_image"`
DisplayName string `json:"display_name"`
Link string `json:"link"`
} `json:"owner"`
IsAnswered bool `json:"is_answered"`
ViewCount int `json:"view_count"`
ProtectedDate int `json:"protected_date"`
AnswerCount int `json:"answer_count"`
Score int `json:"score"`
LastActivityDate int `json:"last_activity_date"`
CreationDate int `json:"creation_date"`
LastEditDate int `json:"last_edit_date,omitempty"`
QuestionID int `json:"question_id"`
ContentLicense string `json:"content_license"`
Link string `json:"link"`
Title string `json:"title"`
Body string `json:"body"`
} `json:"items"`
HasMore bool `json:"has_more"`
QuotaMax int `json:"quota_max"`
QuotaRemaining int `json:"quota_remaining"`
}
type StackOverflowResult ¶
type StackOverflowResult struct {
Items []struct {
Owner struct {
AccountID int `json:"account_id"`
Reputation int `json:"reputation"`
UserID int `json:"user_id"`
UserType string `json:"user_type"`
AcceptRate int `json:"accept_rate"`
ProfileImage string `json:"profile_image"`
DisplayName string `json:"display_name"`
Link string `json:"link"`
} `json:"owner"`
IsAccepted bool `json:"is_accepted"`
Score int `json:"score"`
LastActivityDate int `json:"last_activity_date"`
LastEditDate int `json:"last_edit_date,omitempty"`
CreationDate int `json:"creation_date"`
AnswerID int `json:"answer_id"`
QuestionID int `json:"question_id"`
ContentLicense string `json:"content_license"`
Body string `json:"body"`
CommunityOwnedDate int `json:"community_owned_date,omitempty"`
} `json:"items"`
HasMore bool `json:"has_more"`
QuotaMax int `json:"quota_max"`
QuotaRemaining int `json:"quota_remaining"`
}
Click to show internal directories.
Click to hide internal directories.
