How many bestselling books has Barack Obama written?
What is the new book by Obama?
Can Barack Obama run for president in 2028?
Complementary Results
Overview
Description
Barack Hussein Obama II is an American politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party, he was the first African American to serve as president.Wikipedia
He is the author of two previous bestselling books, Dreams from My Father and The Audacity of Hope, and the recipient of the 2009 Nobel Peace Prize.Read more
https://en.wikipedia.org › wiki › Category:Books_by_B...
:Books by Barack Obama. The following 4 pages are in this category, A The Audacity of Hope D Dreams from My Father O Of Thee I Sing (book) P A Promised Land
https://www.goodreads.com › author › show › 6356.Ba...
He is the author of two previous New York Times bestselling books, Dreams from My Father and The Audacity of Hope, and the recipient of the 2009 Nobel Peace ...Read more
2026 Book 6: What a read this was. Pulitzer Prize winner, and one of Barack Obama's favorites! This book has an incredible structure, unlike ...Read more
Books by Barack Obama · Dreams From My Father · A Promised Land · We Are the Change We Seek: The Speeches of Barack Obama · The Audacity of Hope: Thoughts on ...Read more
https://44thand3rdbookseller.com › list › obama-booklist
Obama Booklist · Poverty, by America · Small Mercies: A Novel · King: A Life · Hello Beautiful (Oprah's Book Club): A Novel · All the Sinners Bleed: A Novel · Birnam ...Read more
\ No newline at end of file
diff --git a/spec/fixtures/taylor-swift-albums.html b/spec/fixtures/taylor-swift-albums.html
new file mode 100644
index 00000000..e854fa11
--- /dev/null
+++ b/spec/fixtures/taylor-swift-albums.html
@@ -0,0 +1,59 @@
+
+Taylor Swift albums - Google Search
https://en.wikipedia.org › wiki › Taylor_Swift_albums_...
Swift has released six original albums—Lover (2019), Folklore (2020), Evermore (2020), Midnights (2022), The Tortured Poets Department (2024), and The Life of ...
Taylor Alison Swift is an American singer-songwriter. An influential figure in popular culture, she is known for her autobiographical songwriting and artistic reinventions. Swift is the highest-grossing live music artist, the wealthiest female musician, and one of the best-selling music artists of all time.Wikipedia
I’m about to go on a really long road trip with my sister and convinced her to listen to Taylor’s ENTIRE discography (about 8 hours) and I’m trying ...
31 answers · Top answer: Release order i always recommend
https://genius.com › artists › Taylor-swift › albums
Taylor Swift discography includes 186 albums Release , I Knew You (10" Vinyl) 2026 Elizabeth Taylor Elizabeth Taylor April 18, 2026 The Bad Girl (single)
Popular releases ; I Knew It, I Knew YouLatest Release · Album ; The Life of a Showgirl2025 · Album ; Lover2019 · Album ; reputation2017 · Album ; THE TORTURED POETS ...Read more
\ No newline at end of file
diff --git a/spec/google_carousel_parser_one_spec.rb b/spec/google_carousel_parser_one_spec.rb
new file mode 100644
index 00000000..2fc75c28
--- /dev/null
+++ b/spec/google_carousel_parser_one_spec.rb
@@ -0,0 +1,66 @@
+require 'rspec'
+require 'json'
+require_relative '../lib/google_carousel_parser_one'
+
+describe GoogleCarouselParserOne do
+ shared_examples "a google carousel search result page" do |filepath, expected_key|
+ let(:parser) { GoogleCarouselParserOne.new(filepath) }
+ let(:result) { parser.parse }
+
+ it "returns a hash containing the expected category key array" do
+ expect(result).to be_a(Hash)
+ expect(result[expected_key]).to be_an(Array)
+ expect(result[expected_key]).not_to be_empty
+ end
+
+ it "validates that every item has a valid name, link array, and extensions array" do
+ result[expected_key].each do |item|
+ expect(item["name"]).to be_a(String)
+ expect(item["name"]).not_to be_empty
+
+ expect(item["link"]).to be_an(Array)
+ expect(item["link"]).not_to be_empty
+ item["link"].each do |url|
+ expect(url).to be_a(String)
+ expect(url).to start_with("https://www.google.com/search")
+ end
+
+ expect(item["extensions"]).to be_an(Array)
+ item["extensions"].each do |ext|
+ expect(ext).to be_a(String)
+ end
+
+ expect(item["image"]).to be_nil
+ end
+ end
+ end
+
+ describe "Van Gogh Paintings Carousel" do
+ it_behaves_like "a google carousel search result page", "files/van-gogh-paintings.html", "artworks"
+ end
+
+ describe "Barack Obama Books Carousel" do
+ it_behaves_like "a google carousel search result page", "spec/fixtures/barack-obama-books.html", "books"
+ end
+
+ describe "Taylor Swift Albums Carousel" do
+ it_behaves_like "a google carousel search result page", "spec/fixtures/taylor-swift-albums.html", "albums"
+ end
+
+ describe "Empty / No Carousel Page" do
+ let(:empty_file) { "spec/fixtures/empty.html" }
+
+ before do
+ File.write(empty_file, "
No Carousel Here
")
+ end
+
+ after do
+ File.delete(empty_file) if File.exist?(empty_file)
+ end
+
+ it "returns an empty hash" do
+ result = GoogleCarouselParserOne.new(empty_file).parse
+ expect(result).to eq({})
+ end
+ end
+end
diff --git a/spec/google_carousel_parser_two_spec.rb b/spec/google_carousel_parser_two_spec.rb
new file mode 100644
index 00000000..dadd4934
--- /dev/null
+++ b/spec/google_carousel_parser_two_spec.rb
@@ -0,0 +1,80 @@
+require 'rspec'
+require 'json'
+require_relative '../lib/google_carousel_parser_two'
+
+describe GoogleCarouselParserTwo do
+ shared_examples "a google carousel search result page" do |filepath, expected_key|
+ let(:parser) { GoogleCarouselParserTwo.new(filepath) }
+ let(:result) { parser.parse }
+
+ it "returns a hash containing the expected category key array" do
+ expect(result).to be_a(Hash)
+ expect(result[expected_key]).to be_an(Array)
+ expect(result[expected_key]).not_to be_empty
+ end
+
+ it "validates that every item has a valid name, link, and optionally extensions/image" do
+ result[expected_key].each do |item|
+ expect(item["name"]).to be_a(String)
+ expect(item["name"]).not_to be_empty
+
+ expect(item["link"]).to be_a(String)
+ expect(item["link"]).to start_with("https://www.google.com/search")
+
+ expect(item["extensions"]).to be_an(Array)
+ item["extensions"].each do |ext|
+ expect(ext).to be_a(String)
+ end
+
+ if item["image"]
+ expect(item["image"]).to be_a(String)
+ expect(item["image"]).to start_with("data:image/").or start_with("https://encrypted-tbn")
+ end
+ end
+ end
+ end
+
+ describe "Van Gogh Paintings Carousel" do
+ it_behaves_like "a google carousel search result page", "files/van-gogh-paintings.html", "artworks"
+
+ it "exactly matches the expected JSON output" do
+ expected = JSON.parse(File.read("files/expected-array.json"))
+ actual = GoogleCarouselParserTwo.new("files/van-gogh-paintings.html").parse
+
+ expect(actual["artworks"].size).to eq(expected["artworks"].size)
+
+ actual["artworks"].each_with_index do |artwork, index|
+ exp = expected["artworks"][index]
+ expect(artwork["name"]).to eq(exp["name"])
+ expect(artwork["link"]).to eq(exp["link"])
+ expect(artwork["extensions"]).to eq(exp["extensions"] || [])
+ expect(artwork["image"]).to eq(exp["image"])
+ end
+ end
+ end
+
+ describe "Barack Obama Books Carousel" do
+ it_behaves_like "a google carousel search result page", "spec/fixtures/barack-obama-books.html", "books"
+ end
+
+ describe "Taylor Swift Albums Carousel" do
+ it_behaves_like "a google carousel search result page", "spec/fixtures/taylor-swift-albums.html", "albums"
+ end
+
+ describe "Empty / No Carousel Page" do
+ let(:empty_file) { "spec/fixtures/empty.html" }
+
+ before do
+ File.write(empty_file, "
No Carousel Here
")
+ end
+
+ after do
+ File.delete(empty_file) if File.exist?(empty_file)
+ end
+
+ it "returns an empty hash" do
+ result = GoogleCarouselParserTwo.new(empty_file).parse
+ expect(result).to eq({})
+ end
+ end
+end