From 93fc6a27f01fbe325c95008b7f336627152ea3c7 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 11 Sep 2024 20:09:18 -0500 Subject: added new download tools --- download-images-fuji.py | 36 ------------------------------------ download-images-fujix100v.py | 36 ++++++++++++++++++++++++++++++++++++ download-images-fujix70.py | 36 ++++++++++++++++++++++++++++++++++++ download-images.py | 12 ++++++------ download-videos.py | 15 +++++++++------ mqq.sh | 5 ++++- rtf.sh | 2 +- weather.sh | 5 ++++- 8 files changed, 96 insertions(+), 51 deletions(-) delete mode 100755 download-images-fuji.py create mode 100755 download-images-fujix100v.py create mode 100755 download-images-fujix70.py mode change 100644 => 100755 download-videos.py diff --git a/download-images-fuji.py b/download-images-fuji.py deleted file mode 100755 index 9a365e1..0000000 --- a/download-images-fuji.py +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/python3 -import os -from shutil import copyfile -import sys - - -if os.path.exists(sys.argv[1]): - path = os.path.abspath(sys.argv[1]) -else: - print("Cannot find " + sys.argv[1]) - exit() -with open('/home/lxf/.photocopyfujirc', 'r') as f: - lastfile = str(f.readline().rstrip()) -sorter = [] -for (dirname, dirs, files) in os.walk(path): - dirn = os.path.abspath(dirname) - for filename in files: - if filename.endswith('.RAF'): - if int(filename.split('DSCF')[1].split(".RAF")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): - sorter.append([int(filename.split('DSCF')[1].split(".RAF")[0]), filename]) - elif filename.endswith('.JPG'): - if int(filename.split('DSCF')[1].split(".JPG")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): - sorter.append([int(filename.split('DSCF')[1].split(".JPG")[0]), filename]) - -for f in sorted(sorter): - dest = '/home/lxf/pictures/inbox/' - if not os.path.exists(dest): - os.makedirs(dest) - print("copying:", dirn+'/'+f[1], "--->", dest+f[1]) - copyfile(dirn+'/'+f[1], dest+f[1]) - try: - out = sorted(sorter)[-1] - with open('/home/lxf/.photocopyfujirc', 'w') as f: - f.write(out[1]) - except IndexError: - pass diff --git a/download-images-fujix100v.py b/download-images-fujix100v.py new file mode 100755 index 0000000..8c9df16 --- /dev/null +++ b/download-images-fujix100v.py @@ -0,0 +1,36 @@ +#! /usr/bin/python3 +import os +from shutil import copyfile +import sys + + +if os.path.exists(sys.argv[1]): + path = os.path.abspath(sys.argv[1]) +else: + print("Cannot find " + sys.argv[1]) + exit() +with open('/home/lxf/.photocopyfujix100vrc', 'r') as f: + lastfile = str(f.readline().rstrip()) +sorter = [] +for (dirname, dirs, files) in os.walk(path): + dirn = os.path.abspath(dirname) + for filename in files: + if filename.endswith('.RAF'): + if int(filename.split('DSCF')[1].split(".RAF")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): + sorter.append([int(filename.split('DSCF')[1].split(".RAF")[0]), filename]) + elif filename.endswith('.JPG'): + if int(filename.split('DSCF')[1].split(".JPG")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): + sorter.append([int(filename.split('DSCF')[1].split(".JPG")[0]), filename]) + +for f in sorted(sorter): + dest = '/home/lxf/pictures/inbox/' + if not os.path.exists(dest): + os.makedirs(dest) + print("copying:", dirn+'/'+f[1], "--->", dest+f[1]) + copyfile(dirn+'/'+f[1], dest+f[1]) + try: + out = sorted(sorter)[-1] + with open('/home/lxf/.photocopyfujix100vrc', 'w') as f: + f.write(out[1]) + except IndexError: + pass diff --git a/download-images-fujix70.py b/download-images-fujix70.py new file mode 100755 index 0000000..c934abb --- /dev/null +++ b/download-images-fujix70.py @@ -0,0 +1,36 @@ +#! /usr/bin/python3 +import os +from shutil import copyfile +import sys + + +if os.path.exists(sys.argv[1]): + path = os.path.abspath(sys.argv[1]) +else: + print("Cannot find " + sys.argv[1]) + exit() +with open('/home/lxf/.photocopyfujix70rc', 'r') as f: + lastfile = str(f.readline().rstrip()) +sorter = [] +for (dirname, dirs, files) in os.walk(path): + dirn = os.path.abspath(dirname) + for filename in files: + if filename.endswith('.RAF'): + if int(filename.split('DSCF')[1].split(".RAF")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): + sorter.append([int(filename.split('DSCF')[1].split(".RAF")[0]), filename]) + elif filename.endswith('.JPG'): + if int(filename.split('DSCF')[1].split(".JPG")[0]) > int(lastfile.split('DSCF')[1].split(".RAF")[0]): + sorter.append([int(filename.split('DSCF')[1].split(".JPG")[0]), filename]) + +for f in sorted(sorter): + dest = '/home/lxf/pictures/inbox/' + if not os.path.exists(dest): + os.makedirs(dest) + print("copying:", dirn+'/'+f[1], "--->", dest+f[1]) + copyfile(dirn+'/'+f[1], dest+f[1]) + try: + out = sorted(sorter)[-1] + with open('/home/lxf/.photocopyfujix70rc', 'w') as f: + f.write(out[1]) + except IndexError: + pass diff --git a/download-images.py b/download-images.py index a0cbf31..5fa6a98 100755 --- a/download-images.py +++ b/download-images.py @@ -3,13 +3,13 @@ import os from shutil import copyfile import sys - +home_directory = os.path.expanduser('~') if os.path.exists(sys.argv[1]): path = os.path.abspath(sys.argv[1]) else: print("Cannot find " + sys.argv[1]) exit() -with open('/home/lxf/.photocopyrc', 'r') as f: +with open(os.path.join(home_directory, '.photocopyrc'), 'r') as f: lastfile = str(f.readline().rstrip()) sorter = [] for (dirname, dirs, files) in os.walk(path): @@ -19,14 +19,14 @@ for (dirname, dirs, files) in os.walk(path): if int(filename.split('DSC')[1].split(".ARW")[0]) > int(lastfile.split('DSC')[1].split(".ARW")[0]): sorter.append([int(filename.split('DSC')[1].split(".ARW")[0]), filename]) for f in sorted(sorter): - dest = '/home/lxf/pictures/inbox/' + dest = os.path.join(home_directory, 'pictures', 'inbox') if not os.path.exists(dest): os.makedirs(dest) - print("copying:", dirn+'/'+f[1], "--->", dest+f[1]) - copyfile(dirn+'/'+f[1], dest+f[1]) + print("copying:", dirn+'/'+f[1], "--->", dest+'/'+f[1]) + copyfile(dirn+'/'+f[1], os.path.join(dest, f[1])) try: out = sorted(sorter)[-1] - with open('/home/lxf/.photocopyrc', 'w') as f: + with open(os.path.join(home_directory, '.photocopyrc'), 'w') as f: f.write(out[1]) except IndexError: pass diff --git a/download-videos.py b/download-videos.py old mode 100644 new mode 100755 index 194edf1..cdf7c8b --- a/download-videos.py +++ b/download-videos.py @@ -2,28 +2,31 @@ import os from shutil import copyfile import sys + +home_directory = os.path.expanduser('~') if os.path.exists(sys.argv[1]): path = os.path.abspath(sys.argv[1]) else: print("Cannot find " + sys.argv[1]) exit() -with open('/home/lxf/.videocopyrc', 'r') as f: +with open(os.path.join(home_directory, '.videocopyrc'), 'r') as f: lastfile = str(f.readline().rstrip()) sorter = [] for (dirname, dirs, files) in os.walk(path): dirn = os.path.abspath(dirname) for filename in files: - if int(filename.split('.MTS')[0]) > int(lastfile.split('.MTS')[0]): - sorter.append([int(filename.split('.MTS')[0]), filename]) + if filename.endswith('.MP4'): + if int(filename.split('C')[1].split(".MP4")[0]) > int(lastfile.split('C')[1].split(".MP4")[0]): + sorter.append([int(filename.split('C')[1].split(".MP4")[0]), filename]) for f in sorted(sorter): - dest = '/home/lxf/videos/inbox/' + dest = os.path.join(home_directory, 'videos', 'inbox') if not os.path.exists(dest): os.makedirs(dest) print("copying:", dirn+'/'+f[1], "--->", dest+f[1]) - copyfile(dirn+'/'+f[1], dest+f[1]) + copyfile(dirn+'/'+f[1], os.path.join(dest, f[1])) try: out = sorted(sorter)[-1] - with open('/home/lxf/.videocopyrc', 'w') as f: + with open(os.path.join(home_directory, '.videocopyrc'), 'w') as f: f.write(out[1]) except IndexError: pass diff --git a/mqq.sh b/mqq.sh index 8fec93d..fb3f827 100755 --- a/mqq.sh +++ b/mqq.sh @@ -3,4 +3,7 @@ #message_id=$(grep -E -i "^Message-id:" | sed -e 's/.*<\(.*\)>/\1/') BODY=$(sed -n '/^Date/,$ p' | grep -E -i '^[^X]+' | sed -En '/^Date/,/application\// p') -echo "${BODY}" | sed -En '/^Date/,/text\/html/ p' > /home/lxf/notes/"$1".txt +echo "${BODY}" | sed -En '/^Date/,/text\/html/ p' > /tmp/output.txt\ +&& vivaldi-snapshot /tmp/output.txt \ +&& read -n 1 \ +&& rm /tmp/output.txt diff --git a/rtf.sh b/rtf.sh index cea89e8..aef2480 100755 --- a/rtf.sh +++ b/rtf.sh @@ -2,6 +2,6 @@ cat $1 \ | pandoc -t html \ > /tmp/output.html \ - && vivaldi-snapshot /tmp/output.html \ + && vivaldi-stable /tmp/output.html \ && read -n 1 \ && rm /tmp/output.html diff --git a/weather.sh b/weather.sh index f23deba..86fe6cd 100755 --- a/weather.sh +++ b/weather.sh @@ -10,7 +10,10 @@ API_KEY="addb94619729b6651f54d5c9984a45d4" # Check on http://openweathermap.org/find : -CITY_ID="5277856" +# washburn +CITY_ID="4497520" +# pensacola +#CITY_ID="4168228" # Select applicable temperature symbol "˚C" or "˚F" : SYMBOL_CELSIUS="˚F" -- cgit v1.2.3-70-g09d2