Goodreads Developers discussion

33 views
questions > Unable to find book description

Comments Showing 1-4 of 4 (4 new)    post a comment »
dateUp arrow    newest »

message 1: by Diego (new)

Diego Aguirre | 2 comments Hi there,

I'm fairly new to iOS development (actually just finishing up an online bootcamp in the next few weeks). I've been able to get my app to parse the xml response from goodreads and pull information like book cover image, ratings, author and title. Unfortunately I can't seem to find the book description at all which is the last little thing I need. Can someone point me in the right direction about how I would go about this. Right now this is an example of a search response from the goodreads api.

"average_rating" = "4.22";
"best_book" = {
"_type" = Book;
author = {
id = {
"__text" = 15085;
"_type" = integer;
};
name = "Frank Miller";
};
id = {
"__text" = 59980;
"_type" = integer;
};
"image_url" = "https://d.gr-assets.com/books/1327940...
"small_image_url" = "https://d.gr-assets.com/books/1327940...
title = "Batman: Year One";
};
"books_count" = {
"__text" = 54;
"_type" = integer;
};
id = {
"__text" = 2501570;
"_type" = integer;
};
"original_publication_day" = {
"_nil" = true;
"_type" = integer;
};
"original_publication_month" = {
"_nil" = true;
"_type" = integer;
};
"original_publication_year" = {
"__text" = 1987;
"_type" = integer;
};
"ratings_count" = {
"__text" = 117138;
"_type" = integer;
};
"text_reviews_count" = {
"__text" = 1458;
"_type" = integer;
};
},
{
"average_rating" = "4.25";
"best_book" = {
"_type" = Book;
author = {
id = {
"__text" = 15085;
"_type" = integer;
};
name = "Frank Miller";
};
id = {
"__text" = 59960;
"_type" = integer;
};
"image_url" = "https://d.gr-assets.com/books/1327892...
"small_image_url" = "https://d.gr-assets.com/books/1327892...
title = "Batman: The Dark Knight Returns";
};
"books_count" = {
"__text" = 53;
"_type" = integer;
};
id = {
"__text" = 1104159;
"_type" = integer;
};
"original_publication_day" = {
"_nil" = true;
"_type" = integer;
};
"original_publication_month" = {
"_nil" = true;
"_type" = integer;
};
"original_publication_year" = {
"__text" = 1986;
"_type" = integer;
};
"ratings_count" = {
"__text" = 112771;
"_type" = integer;
};
"text_reviews_count" = {
"__text" = 2238;
"_type" = integer;
};
},


message 2: by Diego (new)

Diego Aguirre | 2 comments Here's the class instance i'm using in Xcode to pull the following information from the xml which I parsed into a dictionary. Like I mentioned above the description part is not working for me. I just took a wild guess and filled it in at the moment at the bottom just as a placeholder.

+ (BookModel *)bookFromDictionary:(NSDictionary *)dict {
BookModel *book = [BookModel new];

if (dict[@"average_rating"] && [dict[@"average_rating"] isKindOfClass:[NSString class]]) {
book.averageRating = @([dict[@"average_rating"] floatValue]);
}


if (dict[@"best_book"][@"title"]) {
book.title = dict[@"best_book"][@"title"];
}


if (dict[@"best_book"][@"author"][@"name"]) {
book.author = dict[@"best_book"][@"author"][@"name"];
}

if (dict[@"best_book"][@"image_url"]) {
book.imageURL = dict[@"best_book"][@"image_url"];
}

if (dict[@"id"][@"__text"]) {
book.bookId = dict[@"id"][@"__text"];
}

if (dict[@"description"]) {
book.summary = dict[@"description"];
}


return book;
}


message 3: by JanFranz (new)

JanFranz | 1 comments Hi there,

I am currently struggling about nearly the same question, except that I need the page-count and the ISBN as well.

Did you manage to find a solution?


message 4: by Jeff (new)

Jeff (jeffwong) | 75 comments Mod
Our search API call doesn't provide a description in the search results because our apps don't use the description in the search results.


back to top