jojoleprowebsite

[Done] The Sauce of https://jojolepro.com
git clone https://git.jojolepro.com/jojoleprowebsite.git
Log | Files | Refs | README | LICENSE

commit 674d1ae6e0751cbfe6360a32deb3d40c2a8dd227
parent 0abee83ecd316f9b26b0b7c2ae382176f1c39cab
Author: Joël Lupien (Jojolepro) <jojolepro@jojolepro.com>
Date:   Thu,  9 Apr 2020 22:02:23 -0400

fix gt lt amp formatting

Diffstat:
Mbuild.sh | 8++++----
Mbuild/blog/2020-03-31_extracting_data_from_websites/index.html | 8++++----
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/build.sh b/build.sh @@ -12,9 +12,9 @@ while read -r page; do case $page in *.txt) - sed "s/</&lt/g" "../src/$page" | - sed "s/>/&gt/g" | - sed "s/&/&amp/g" | + sed "s/&/\&amp;/g" "../src/$page" | + sed "s/</\&lt;/g" | + sed "s/>/\&gt;/g" | sed -E "s|([^=][^\'\"])(https[:]//[^ )]*)|\1<a href='\2'>\2</a>|g" | @@ -25,7 +25,7 @@ while read -r page; do sed '/%%CONTENT%%/r /dev/stdin' /tmp/template.html | sed '/%%CONTENT%%/d' | - sed "s %%SOURCE%% /${page##./} " \ + sed "s|%%SOURCE%%|/${page##./}|" \ > "${page%%.txt}.html" ln -f "../src/$page" "$page" diff --git a/build/blog/2020-03-31_extracting_data_from_websites/index.html b/build/blog/2020-03-31_extracting_data_from_websites/index.html @@ -234,9 +234,9 @@ can remove sections of it. Here, the following request works: -$ curl "https://weather.gc.ca/radar/xhr.php?action=retrieve&amptarget=images"\ -"&ampregion=WUJ&ampproduct=PRECIP_SNOW&amplang=en-CA&ampformat=json" \ --H 'X-Requested-With:XMLHttpRequest' >gt /tmp/data.txt +$ curl "https://weather.gc.ca/radar/xhr.php?action=retrieve&amp;target=images"\ +"&amp;region=WUJ&amp;product=PRECIP_SNOW&amp;lang=en-CA&amp;format=json" \ +-H 'X-Requested-With:XMLHttpRequest' &gt; /tmp/data.txt Getting Our Sources ================================================================================ @@ -256,7 +256,7 @@ Since those aren't actually urls (they are missing <a href='https://....'>https: those. $ cat /tmp/data.txt | jq -r '.short | map(.src) | .[]' | sed \ -'s/^/https:\/\/weather.gc.ca/' >gt /tmp/urls.txt +'s/^/https:\/\/weather.gc.ca/' &gt; /tmp/urls.txt If we look at our file, we see that everything looks good: