You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
922 B
32 lines
922 B
#!/bin/bash |
|
|
|
URLS="https://vandrouki.ru https://vandrouki.by https://vandrouki.asia" |
|
# URLS="https://vandrouki.by" |
|
|
|
rstc="\033[00m" |
|
yellow="\033[1;33m" |
|
blue="\033[1;36m" |
|
green="\033[1;32m" |
|
|
|
for url in $URLS; { |
|
echo -e "$green> $url $rstc\n" |
|
|
|
curl -s -q "$url" \ |
|
| sed 's/<html.*xmlns.*$//g' \ |
|
| xmllint --html --xpath "//html/body/div[@id='content']/div[@id='primary']/div/*[self::div/span[@class='published'] or self::h2/a]" - 2>&- \ |
|
| tr '\n' '\r' \ |
|
| sed -e 's/\r\r/####/g; s/\r/@/g; s/####/\n/g; s/<h2 class="entry-title">/\n/g' \ |
|
| sed 's/href="/@/; s/" rel=[^>]*>/@/; s/published.>/@/' \ |
|
| sed -E 's|^</div>@||; s/&#[0-9]+;//g' \ |
|
| sed '/^\s*$/d' \ |
|
| awk -F'@' -v blue="$blue" -v yellow="$yellow" -v green="$green" -v rstc="$rstc" \ |
|
'{ |
|
print blue " # " $6 "@" yellow toupper($3) "\n@ " green $2 rstc |
|
}' \ |
|
| sed 's/@@@*/@@/g' \ |
|
| sed -e :a -e 's/<[^>]*>//g;/</N;//ba' \ |
|
| column -t -s @ |
|
|
|
echo |
|
} |
|
|
|
|