summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-09-11 20:09:18 -0500
committerluxagraf <sng@luxagraf.net>2024-09-11 20:09:18 -0500
commit93fc6a27f01fbe325c95008b7f336627152ea3c7 (patch)
tree73171981a4a9b7b145687b10995fb98c051982d0
parent558d3c8503879871c9b291839ef4b15fe85c5e88 (diff)
added new download tools
-rwxr-xr-xdownload-images-fujix100v.py36
-rwxr-xr-xdownload-images-fujix70.py (renamed from download-images-fuji.py)4
-rwxr-xr-xdownload-images.py12
-rwxr-xr-x[-rw-r--r--]download-videos.py15
-rwxr-xr-xmqq.sh5
-rwxr-xr-xrtf.sh2
-rwxr-xr-xweather.sh5
7 files changed, 62 insertions, 17 deletions
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-fuji.py b/download-images-fujix70.py
index 9a365e1..c934abb 100755
--- a/download-images-fuji.py
+++ b/download-images-fujix70.py
@@ -9,7 +9,7 @@ if os.path.exists(sys.argv[1]):
else:
print("Cannot find " + sys.argv[1])
exit()
-with open('/home/lxf/.photocopyfujirc', 'r') as f:
+with open('/home/lxf/.photocopyfujix70rc', 'r') as f:
lastfile = str(f.readline().rstrip())
sorter = []
for (dirname, dirs, files) in os.walk(path):
@@ -30,7 +30,7 @@ for f in sorted(sorter):
copyfile(dirn+'/'+f[1], dest+f[1])
try:
out = sorted(sorter)[-1]
- with open('/home/lxf/.photocopyfujirc', 'w') as f:
+ 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
index 194edf1..cdf7c8b 100644..100755
--- 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"