From 391569a9c806fd652774d8ad41a1fea32f80cb1c Mon Sep 17 00:00:00 2001 From: Christopher Guess Date: Fri, 15 Dec 2023 12:19:52 -0500 Subject: [PATCH] user urls are no longer nil --- lib/mosquito/scrapers/user_scraper.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/mosquito/scrapers/user_scraper.rb b/lib/mosquito/scrapers/user_scraper.rb index 76f2ba0..7334694 100644 --- a/lib/mosquito/scrapers/user_scraper.rb +++ b/lib/mosquito/scrapers/user_scraper.rb @@ -51,19 +51,19 @@ def parse(username) user = { id: id, - name: full_name, - username: username, - sign_up_date: sign_up_date, - location: location, - profile_image_url: profile_image_url, - description: description, - followers_count: followers_count, - following_count: following_count, - tweet_count: tweet_count, - listed_count: listed_count, - verified: verified, + name: full_name.nil? ? "" : full_name, + username: username.nil? ? "" : username, + sign_up_date: sign_up_date.nil? ? "" : sign_up_date, + location: location.nil? ? "" : location, + profile_image_url: profile_image_url.nil? ? "" : profile_image_url, + description: description.nil? ? "" : description, + followers_count: followers_count.nil? ? "" : followers_count, + following_count: following_count.nil? ? "" : following_count, + tweet_count: tweet_count.nil? ? "" : tweet_count, + listed_count: listed_count.nil? ? "" : listed_count, + verified: verified.nil? ? false : verified, url: url.nil? ? "" : url, - profile_image_file_name: profile_image_file_name + profile_image_file_name: profile_image_file_name.nil? ? "" : profile_image_file_name } user