You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for this great script, I found it a few days ago and it's really useful :) This isn't really an issue, per se, but something I thought it might be nice to amend if using the separate metadata files.
I had a look at the pagesource and it looks like the descriptions were being taken from <meta property="og:description" content=", unfortunately that gives incomplete descriptions limited to ~121 characters without spaces.
I'd like to propose the following edit to copy the full description. There was also an '& quot ;' issue in some of the titles which is hopefully sorted as well. It might not be the cleanest way of doing it, but it seems to work okay. It copies it verbatim, so if they've put a lot of linebreaks in the desc, they'll appear in the metadata file. I'm interested to hear what you think :)
From line 147 'Get metadata'
description="$(cat "$tempfile" | tr '\n' ' ' | sed 's/\(<div class="submission-description">\)/\n\1/gI' | sed 's/\(<\/div>\)/\1\n/gI' | grep -o '<div class="submission-description".*</div>' | sed 's/<div class="submission-description"> //g' | sed 's@<br />@\n@g' | sed 's/<a href="//g' | sed 's@" class=".*</a>@@g' | sed 's@ </div>@@g' | sed 's/"/"/g')"
if [ $classic = true ]; then
title="$(grep -Eo '<h2>.*</h2>' "$tempfile" | awk -F "<h2>" '{print $2}' | awk -F "</h2>" '{print $1}' | sed 's/"/"/g')"
else
title="$(grep -Eo '<h2><p>.*</p></h2>' "$tempfile" | awk -F "<p>" '{print $2}' | awk -F "</p>" '{print $1}' | sed 's/"/"/g')"
fi
The text was updated successfully, but these errors were encountered:
Minor update to clean up a few more things in the description from line 148: description="$(cat "$tempfile" | tr '\n' ' ' | sed 's/\(<div class="submission-description">\)/\n\1/gI' | sed 's/\(<\/div>\)/\1\n/gI' | grep -o '<div class="submission-description".*</div>' | sed 's/<div class="submission-description"> //g' | sed 's@<br />@\n@g' | sed 's@" title=.*</a>@@g' | sed 's/<a href="//g' | sed 's@" class=".*</a>@@g' | sed 's@ </div>@@g' | sed 's/"/"/g' | sed 's/<a class="auto_link named_url" href="//g' | sed 's@</a>@@g' | sed 's/././g' | sed 's@<i class=".*</i>@@g' | sed 's/>/>/g' | sed 's/</</g' | sed 's/" class="iconusername.*align="middle//g' | sed 's/&/\&/g' | sed "s/'/'/g" | sed 's/£/£/g' | sed 's/¥/¥/g' | sed 's/€/€/g' | sed 's/<span.*span>//g' | sed 's/<strong class="bbcode bbcode_b">//g' | sed 's/<a class="auto_link named_url" href="//g' | sed 's/">.*strong>//g' | sed 's/">/ /g' | sed 's/\r//g' | sed 's/^ //g')"
if [ $classic = true ]; then title="$(grep -Eo '<h2>.*</h2>' "$tempfile" | awk -F "<h2>" '{print $2}' | awk -F "</h2>" '{print $1}' | sed 's/"/"/g' | sed 's/&/\&/g' | sed 's@/@_@g')" else title="$(grep -Eo '<h2><p>.*</p></h2>' "$tempfile" | awk -F "<p>" '{print $2}' | awk -F "</p>" '{print $1}' | sed 's/"/"/g' | sed 's/&/\&/g' | sed 's@/@_@g')"
Hi, thanks for this great script, I found it a few days ago and it's really useful :) This isn't really an issue, per se, but something I thought it might be nice to amend if using the separate metadata files.
I had a look at the pagesource and it looks like the descriptions were being taken from <meta property="og:description" content=", unfortunately that gives incomplete descriptions limited to ~121 characters without spaces.
I'd like to propose the following edit to copy the full description. There was also an '& quot ;' issue in some of the titles which is hopefully sorted as well. It might not be the cleanest way of doing it, but it seems to work okay. It copies it verbatim, so if they've put a lot of linebreaks in the desc, they'll appear in the metadata file. I'm interested to hear what you think :)
From line 147 'Get metadata'
The text was updated successfully, but these errors were encountered: