Last active
August 6, 2023 01:13
-
-
Save CDanU/38414e4014b483b562115427f4e3f05c to your computer and use it in GitHub Desktop.
Combine all messages.*.html files into one, uses pup to extract html elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HTML_SELECTOR=".message" | |
for FILE in $(ls -1v messages*); do | |
cat ${FILE} | pup ${HTML_SELECTOR} >> data.html; | |
done | |
DATA=$(cat data.html); eval "cat <<EOF | |
$(<template.html) | |
EOF | |
" > all.html | |
rm data.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src: https://stackoverflow.com/a/12422379 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Exported Data</title> | |
<meta content="width=device-width, initial-scale=1.0" name="viewport"/> | |
<link href="css/style.css" rel="stylesheet"/> | |
<script src="js/script.js" type="text/javascript"> | |
</script> | |
</head> | |
<body onload="CheckLocation();"> | |
<div class="page_wrap"> | |
<div class="page_header"> | |
<div class="content"> | |
<div class="text bold"> | |
[NAME] | |
</div> | |
</div> | |
</div> | |
<div class="page_body chat_page"> | |
<div class="history"> | |
${DATA} | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
- stackoverflow src -