Skip to content

Commit

Permalink
improve WhatsApp test
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasRieger committed Jan 17, 2019
1 parent 523d3fc commit 0dd13d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/readWhatsApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ readWhatsApp = function(path = getwd(), file = list.files(path = path,
"<span dir=\"auto\" class=\"quoted-mention\">(.*?)</div>")))
# Zitat koennte Emojis enthalten?!
}
else{
mData$citedAuthor = NA
mData$citedText = NA
}

mData$time[mData$userMessage] = removeXML(stringr::str_extract(obs[mData$userMessage],
"<span class=\"_3EFt_\">(.*?)</span>"))
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/data/WhatsApp/WhatsApp2.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@

<div class="_2f-RV"><div class="_1DZAH"><span class="_1ORuP"></span><span class="_3EFt_">19:12</span></div></div></div><span></span></div></div><div class="vW7d1 _3rjxZ"><div class="_3_7SH Zq3Mc"><span dir="auto" class="">HEUTE</span></div></div><div class="vW7d1"><span></span><div class="_3_7SH _3DFk6 message-in tail"><span class="tail-container"></span><span class="tail-container highlight"></span><div class="Tkt2p"><div class="copyable-text" data-pre-plain-text="[18:57, 30.11.2018] Ressource: "><div class="_3zb-j ZhF0n"><span dir="ltr" class="selectable-text invisible-space copyable-text">So Long, and Thanks for All the Fish: <a href="Link" title="Link" target="_blank" rel="noopener noreferrer" class="selectable-text invisible-space copyable-text">Link</a>

<div class="bla"><span dir="auto" class="quoted-mention">Citation text</span></div>

</span></div></div><div class="_2f-RV"><div class="_1DZAH"><span class="_1ORuP"></span><span class="_3EFt_">18:57</span>


Expand Down

0 comments on commit 0dd13d7

Please sign in to comment.