comparison app/lib/legit_client.rb @ 249:9e5f9ffa4077

Snake case
author nanaya <me@nanaya.net>
date Mon, 17 Jul 2023 04:40:46 +0900
parents bc2f45058c9e
children 151bc6d97d39
comparison
equal deleted inserted replaced
248:d6a545dba986 249:9e5f9ffa4077
107 entry['content']['items'].each do |item| 107 entry['content']['items'].each do |item|
108 acc.push(item['item']) 108 acc.push(item['item'])
109 end 109 end
110 end 110 end
111 acc 111 acc
112 end.map { |rawTweet| normalize_tweet(rawTweet['itemContent']['tweet_results']['result']) } 112 end.map { |raw_tweet| normalize_tweet(raw_tweet['itemContent']['tweet_results']['result']) }
113 .filter { |tweet| !tweet.nil? && tweet.dig(:user, :id) == user_id } 113 .filter { |tweet| !tweet.nil? && tweet.dig(:user, :id) == user_id }
114 end 114 end
115 115
116 def self.normalize_tweet(json) 116 def self.normalize_tweet(json)
117 return nil if json.nil? 117 return nil if json.nil?