<commit_before>package gr

type Goodreads struct {
	Key    string
	Secret string
}

func (g *Goodreads) getRequest(params map[string]string, endpoint string) ([]byte, error) {
	v := url.Values{}
	v.Set("key", g.Key)
	for key, val := range params {
		v.Set(key, val)
	}
	u := apiURL + endpoint + "?" + v.Encode()
	resp, err := http.Get(u)
	if err != nil {<commit_msg>add structs<commit_after>package gr

import (
	"encoding/xml"
	"io/ioutil"
	"net/http"
	"net/url"
)

const apiURL = "https://www.goodreads.com/"

type Goodreads struct {
	Key    string
	Secret string
}

type Author struct {
	Id   int
	Name string
}

type GoodreadsResponse struct {
	Search Search
	Query  string
}

type Search struct {
	ResultsStart     int `xml:"results-start"`
	ResultsEnd       int `xml:"results-end"`
	TotalResults     int `xml:"total-results"`
	Source           string
	QueryTimeSeconds float64 `xml:"query-time-seconds"`
	Results          Results
}

type Results struct {
	Works []Work
}

type Work struct {
	BooksCount               int `xml:"books_count"`
	Id                       int
	OriginalPublicationDay   int      `xml:"original_publication_day",omitempty`
	OriginalPublicationMonth int      `xml:"original_publication_month",omitempty`
	OriginalPublicationYear  int      `xml:"original_publication_year",omitempty`
	RatingsCount             int      `xml:"ratings_count"`
	TextReviewsCount         int      `xml:"text_reviews_count"`
	AverageRating            float64  `xml:"average_rating"`
	BestBook                 BestBook `xml:"best_book"`
}

type BestBook struct {
	Id            int
	Title         string
	Author        Author
	ImageURL      string `xml:"image_url"`
	SmallImageURL string `xml:"small_image_url"`
}

func (g *Goodreads) getRequest(params map[string]string, endpoint string) ([]byte, error) {
	v := url.Values{}
	v.Set("key", g.Key)
	for key, val := range params {
		v.Set(key, val)
	}
	u := apiURL + endpoint + "?" + v.Encode()
	resp, err := http.Get(u)
	if err != nil {
{'fraction_non_alphanumeric': 0.1179718875502008, 'fraction_numerical': 0.002008032128514056, 'mean_word_length': 3.0924024640657084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 15}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3757774', 'n_tokens_mistral': 668, 'n_tokens_neox': 650, 'n_words': 169}