Skip to content

Commit

Permalink
remove tag as a key, add tag as value to title
Browse files Browse the repository at this point in the history
  • Loading branch information
vasconsaurus committed Jul 19, 2023
1 parent 5f0972a commit 2d200ca
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/models/parser/tiktok_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,26 @@ def parse_data_for_parser(doc, _original_url, _jsonld_array)
match = url.match(TIKTOK_ITEM_URL)
username = match['username']
external_id = match['id']
tag = ''
title = parsed_data['raw']['api']['title']
elsif url.match(TIKTOK_TAG_URL)
username = ''
external_id = ''
tag = url.match(TIKTOK_TAG_URL)['tag']
title = "Tag: " + url.match(TIKTOK_TAG_URL)['tag']
else
username = ''
external_id = ''
tag = ''
title = parsed_data['raw']['api']['title']
end

@parsed_data.merge!({
username: username,
external_id: external_id,
description: parsed_data['raw']['api']['title'],
title: parsed_data['raw']['api']['title'],
description: title,
title: title,
picture: parsed_data['raw']['api']['thumbnail_url'],
author_url: parsed_data['raw']['api']['author_url'],
html: parsed_data['raw']['api']['html'],
author_name: parsed_data['raw']['api']['author_name'],
tag: tag
author_name: parsed_data['raw']['api']['author_name']
})
end
parsed_data
Expand Down

0 comments on commit 2d200ca

Please sign in to comment.