Skip to content

Commit

Permalink
Merge pull request #21 from baddiservices/dev
Browse files Browse the repository at this point in the history
Update parsing comment emoji
  • Loading branch information
5baddi authored Jan 2, 2021
2 parents 03e1884 + e4c7356 commit 35efdb9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions app/Services/InstagramScraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,18 +642,8 @@ private function getCommentEmojis(string $comment) : array
return [];

// Parse emojis
$_emojis = $this->emojiParser->matchAll($comment);

// Ignore empty emojis list
if(empty($_emojis))
return [];

// Slice empty emoji
$emojis = [];
array_walk($_emojis, function($item, $key) use (&$emojis){
if(!is_null($item) && !empty($item) && $item !== '#' && $item !== '')
array_push($emojis, $item);
});
$emojiResult = \Emoji\detect_emoji($comment);
$emojis = collect($emojiResult)->pluck('emoji')->toArray();

$this->log('Parsed Emojis: ' . sizeof($emojis));

Expand Down

0 comments on commit 35efdb9

Please sign in to comment.