Skip to content

Commit

Permalink
fix: remove unused structs
Browse files Browse the repository at this point in the history
  • Loading branch information
henomis committed May 24, 2024
1 parent 2fc04f8 commit 290da52
Showing 1 changed file with 4 additions and 71 deletions.
75 changes: 4 additions & 71 deletions tools/serpapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,67 +24,17 @@ type response struct {
}

type apiResponse struct {
SearchMetadata SearchMetadata `json:"search_metadata"`
SearchParameters SearchParameters `json:"search_parameters"`
SearchInformation SearchInformation `json:"search_information"`
InlineImagesSuggestedSearches []InlineImagesSuggestedSearches `json:"inline_images_suggested_searches"`
InlineImages []InlineImages `json:"inline_images"`
AnswerBox AnswerBox `json:"answer_box"`
OrganicResults []OrganicResults `json:"organic_results"`
Pagination Pagination `json:"pagination"`
SerpapiPagination SerpapiPagination `json:"serpapi_pagination"`
}
type SearchMetadata struct {
ID string `json:"id"`
Status string `json:"status"`
JSONEndpoint string `json:"json_endpoint"`
CreatedAt string `json:"created_at"`
ProcessedAt string `json:"processed_at"`
GoogleURL string `json:"google_url"`
RawHTMLFile string `json:"raw_html_file"`
TotalTimeTaken float64 `json:"total_time_taken"`
}
type SearchParameters struct {
Engine string `json:"engine"`
Q string `json:"q"`
GoogleDomain string `json:"google_domain"`
Hl string `json:"hl"`
Gl string `json:"gl"`
Device string `json:"device"`
}
type SearchInformation struct {
QueryDisplayed string `json:"query_displayed"`
TotalResults int `json:"total_results"`
TimeTakenDisplayed float64 `json:"time_taken_displayed"`
OrganicResultsState string `json:"organic_results_state"`
}
type InlineImagesSuggestedSearches struct {
Name string `json:"name"`
Link string `json:"link"`
Uds string `json:"uds"`
Q string `json:"q"`
SerpapiLink string `json:"serpapi_link"`
Thumbnail string `json:"thumbnail"`
}
type InlineImages struct {
Link string `json:"link"`
Source string `json:"source"`
Thumbnail string `json:"thumbnail"`
Original string `json:"original"`
Title string `json:"title"`
SourceName string `json:"source_name"`
}
type AnswerBox struct {
Type string `json:"type"`
Title string `json:"title"`
Thumbnail string `json:"thumbnail"`
OrganicResults []OrganicResults `json:"organic_results"`
}

type Top struct {
Extensions []string `json:"extensions"`
}

type RichSnippet struct {
Top Top `json:"top"`
}

type OrganicResults struct {
Position int `json:"position"`
Title string `json:"title"`
Expand All @@ -98,23 +48,6 @@ type OrganicResults struct {
RichSnippet RichSnippet `json:"rich_snippet,omitempty"`
SnippetHighlightedWords []string `json:"snippet_highlighted_words,omitempty"`
}
type OtherPages struct {
Num2 string `json:"2"`
Num3 string `json:"3"`
Num4 string `json:"4"`
Num5 string `json:"5"`
}
type Pagination struct {
Current int `json:"current"`
Next string `json:"next"`
OtherPages OtherPages `json:"other_pages"`
}
type SerpapiPagination struct {
Current int `json:"current"`
NextLink string `json:"next_link"`
Next string `json:"next"`
OtherPages OtherPages `json:"other_pages"`
}

type result struct {
Title string
Expand Down

0 comments on commit 290da52

Please sign in to comment.