From c560ae0b2a0c714c9944fa988632527f4f2630b4 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Wed, 19 Feb 2025 17:40:48 +1000 Subject: Major YAR!! Moved the post download code from the SuckIt's to the main script, and combined what's left. Minor icon tweak. Think I have almost figured out the HTML and CSS to get the layout to behave. Major rearrange of the main script. Use more of lunamark and RE. Moar colours! Solved the generic colour shenanigans. Solved a few other bugs. Hidden directories. Lots of things I forgot about. --- SuckIt | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 SuckIt (limited to 'SuckIt') diff --git a/SuckIt b/SuckIt new file mode 100755 index 0000000..57aa88b --- /dev/null +++ b/SuckIt @@ -0,0 +1,69 @@ +#!/bin/bash + +TIMEFORMAT=" took %lR using %P%% CPU" +time { +pushd /opt/merged + +rm -fr Foswiki/* +cp -r /opt/merged_EMPTY/Foswiki . +rm -fr PmWiki/* +cp -r /opt/merged_EMPTY/PmWiki . + + +filter=" + -name _default -prune -o \ + -name _empty -prune -o \ + -name System -prune -o \ + -name Trash -prune -o \ + -name TWiki -prune -o \ +" +URL="https://fos.wiki.devuan.org" +time find /opt/Foswiki/data ${filter} \ +-name "*.txt" -type f,l -printf "%P\n" | while read line +do + base=`echo "${line}" | cut -d '/' -f 1` + file=`echo "${line}" | cut -d '/' -f 2- | rev | cut -b 5- | rev` + if [[ ! $file =~ (AdminGroup|AdminUser|AdminUserLeftBar|EditorGroup|GroupTemplate|GroupViewTemplate|NobodyGroup|PatternSkinUserViewTemplate|ProjectContributor|RegistrationAgent|SitePreferences|UnprocessedRegistrations|UnprocessedRegistrationsLog|UserHomepageHeader|UserList|UserListByDateJoined|UserListByLocation|UserList|UserListHeader|WebAtom|WebChanges|WebCreateNewTopic|WebHome|WebIndex|WebLeftBar|WebLeftBarExample|WebNotify|WebPreferences|WebRss|WebSearch|WebSearchAdvanced|WebTopicList|WikiGroups|WikiUsers)$ ]]; then + time=`date --rfc-3339=seconds -ur /opt/Foswiki/data/${base}/${file}.txt | cut -d '+' -f 1` + mkdir -p Foswiki/$base + mkdir -p Foswiki/${base}/`dirname ${file}` + echo -e "ogWiki=Foswiki\nogURL=${URL}\nogBase=${base}\nogFile=${file}\ntimestamp=${time}\n" > Foswiki/${base}/${file}.md.md + echo "downloading ${URL}/${base}/${file}?cover=print" + # Doesn't help with redownloads, coz natch a dynamic site isn't cached. But I can at least comment out the curl command during testing to save time. + curl --silent --no-progress-meter ${URL}/${base}/${file}?cover=print -o Foswiki/${base}/${file}.HTM + fi +done + + +filter=" + -not -name "*~" -a \ + -not -name ".flock" -a \ + -not -name ".htaccess" -a \ + -not -name ".lastmod" -a \ + -not -name ".pageindex" -a \ +" +URL="https://wiki.devuan.org" +time find /opt/pmwiki/wiki.d ${filter} \ +-name "*.*" -type f,l -printf "%P\n" | while read line +do + base=`echo "${line}" | cut -d '.' -f 1` + if [[ "${base}" != "Site" ]]; then + file=`echo "${line}" | cut -d '.' -f 2` + time=`date --rfc-3339=seconds -ur /opt/pmwiki/wiki.d/${base}.${file} | cut -d '+' -f 1` + mkdir -p PmWiki/$base + echo -e "ogWiki=PmWiki\nogURL=${URL}\nogBase=${base}\nogFile=${file}\ntimestamp=${time}\n" > PmWiki/${base}/${file}.md.md +# echo "downloading ${URL}/?n=${base}.${file}?action=markdown" +# curl --no-progress-meter ${URL}/?n=${base}.${file}?action=markdown -o PmWiki/${base}/${file}.MARKDOWN + echo "downloading ${URL}/?n=${base}.${file}?action=print" + curl --no-progress-meter ${URL}/?n=${base}.${file}?action=print -o PmWiki/${base}/${file}.HTM + +# pandoc -f markdown -t commonmark_x --self-contained PmWiki//${base}/${file}.MD >PmWiki/${base}/${file}.md +# pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md + fi +done + + +time notYetAnotherWiki.lua + +popd +} -- cgit v1.1