Skip to content

Commit

Permalink
Merge pull request #15 from st-tech/validation
Browse files Browse the repository at this point in the history
Add validation
  • Loading branch information
takanamito authored Apr 18, 2019
2 parents 431dc1f + 0b18fed commit 5bc2111
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lambda/crawler/crawler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def search
def save
@fashion_check_tweets.each do |tweet|
begin
next unless tweet.valid?
@dynamodb.put_item(tweet.dynamo_params)
rescue Aws::DynamoDB::Errors::ConditionalCheckFailedException
puts "DynamoDB put_item failed. url: #{tweet.tweet_url}"
Expand Down
2 changes: 1 addition & 1 deletion lambda/crawler/fashion_check_tweet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def valid?
private

def parse
@account_id = @tweet.user.name
@account_id = @tweet.user.screen_name
@tweet_url = @tweet.url.to_s
@image_url = @tweet.user.profile_image_url.to_s
score_text = @tweet.text.match(TWEET_TEMPLATE_JP) || @tweet.text.match(TWEET_TEMPLATE_EN)
Expand Down

0 comments on commit 5bc2111

Please sign in to comment.