From d89220e326626baeaaefa87b0a93ada2feaff308 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 00:01:08 -0500 Subject: [PATCH 1/5] simple trss rss reader coming soon(tm) --- Makefile | 1 + sh/trss | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 sh/trss diff --git a/Makefile b/Makefile index fe7308e..bbe7512 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ man: sh: mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f sh/paste $(DESTDIR)$(PREFIX)/bin + cp -f sh/trss $(DESTDIR)$(PREFIX)/bin cp -f sh/disp $(DESTDIR)$(PREFIX)/bin cp -f sh/wallpaper $(DESTDIR)$(PREFIX)/bin cp -f sh/yt $(DESTDIR)$(PREFIX)/bin diff --git a/sh/trss b/sh/trss new file mode 100755 index 0000000..c7e0180 --- /dev/null +++ b/sh/trss @@ -0,0 +1,39 @@ +#!/bin/sh + +# get configuration & data directories +DATA="$HOME/.cache/trss" +CONFIG="$HOME/.config/trss" + +# make sure these directories are in place +mkdir -p "$DATA" +mkdir -p "$CONFIG" + +import_information () { + FEEDS="" + for i in "$CONFIG"/*; do + . "$i" + [ -z "$FEEDS" ] && FEEDS="$NAME" || FEEDS="$FEEDS $NAME" + done +} + +synchronize () { + for i in $FEEDS; do + url="$(get_feed_attr "$i" feed)" + printf "> synchronizing feed %s via url %s\n" "$i" "$url" + curl "$url" -so "$DATA/${i}.xml" + + # generate sfeed formatted file + printf "> creating sfeed compound feed file for feed %s\n" "$i" + cat "$DATA/${i}.xml" | sfeed | cat - "$DATA/${i}.sfeed" | uniq >> "$DATA/${i}.tmp.sfeed" + mv "$DATA/${i}.tmp.sfeed" "${DATA}/${i}.sfeed" + done +} + +get_feed_attr () { + eval "printf '%s' \${$1_$2}" +} + +import_information +synchronize +printf "%s\n" "$FEEDS" +get_feed_attr seirdy humanname From 45faf87871f5f058c5c0d7c28f69f12e05116bb3 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 00:02:38 -0500 Subject: [PATCH 2/5] add check to makefile, hopefully work through the shellcheck error output --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index bbe7512..823f7ea 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,9 @@ sh: cp -f sh/pash-dmenu $(DESTDIR)$(PREFIX)/bin cp -f sh/pash-dmenu-backend $(DESTDIR)$(PREFIX)/bin +check: + shellcheck sh/* + mkc: c/scream c/timer c/boid c/anaconda c/simplestatus c/colors c/boid: From 7cd526b0bdcb52b42499786f84b7bb070d101353 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 00:04:31 -0500 Subject: [PATCH 3/5] make paste work again --- sh/paste | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sh/paste b/sh/paste index 89b5eb0..87987e0 100755 --- a/sh/paste +++ b/sh/paste @@ -1,5 +1,4 @@ #!/bin/sh -set -x [ "$1" = "" ] && exit 1 -[ -f "$1" ] && curl -F"file=@${1}" https://ttm.sh && exit 0 +[ -f "$1" ] && curl -F"file=@${1}" https://0x0.st && exit 0 From 2e24a2387ad8e3fb51596d0d395cf75005e42871 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 00:05:23 -0500 Subject: [PATCH 4/5] no need for snownews stuff, i'll hopefully get trss working --- Makefile | 1 - sh/snownews-url-handler | 7 ------- 2 files changed, 8 deletions(-) delete mode 100755 sh/snownews-url-handler diff --git a/Makefile b/Makefile index 823f7ea..6107751 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,6 @@ sh: cp -f sh/pco $(DESTDIR)$(PREFIX)/bin cp -f sh/git-survey $(DESTDIR)$(PREFIX)/bin cp -f sh/vim-swap-handler $(DESTDIR)$(PREFIX)/bin - cp -f sh/snownews-url-handler $(DESTDIR)$(PREFIX)/bin cp -f sh/status $(DESTDIR)$(PREFIX)/bin cp -f sh/cfg $(DESTDIR)$(PREFIX)/bin cp -f sh/fire $(DESTDIR)$(PREFIX)/bin diff --git a/sh/snownews-url-handler b/sh/snownews-url-handler deleted file mode 100755 index 50bcff7..0000000 --- a/sh/snownews-url-handler +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# tube="$(printf "%s\n" "$1" | grep "watch?v=" | wc -l)" -# [ "$tube" -eq 1 ] && mpv -v --video-sync=display-resample "$1" && exit - -firefox $1 -killall -10 simplestatus From 03ffeaadaf8f28834aeba132b5bb49a147255ab4 Mon Sep 17 00:00:00 2001 From: randomuser Date: Wed, 13 Jul 2022 18:28:23 -0500 Subject: [PATCH 5/5] add some random crap --- etc/southwest_tracker.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 etc/southwest_tracker.py diff --git a/etc/southwest_tracker.py b/etc/southwest_tracker.py new file mode 100644 index 0000000..2cf2258 --- /dev/null +++ b/etc/southwest_tracker.py @@ -0,0 +1,26 @@ +import httplib2 +import json +import math +import time + +# fun fact: i got bored so made this on a southwest flight + +while True: + request = httplib2.Http() + # you have to look in the network tab in 'inspect element', and find the '_' parameter, and paste that in + # of course, you have to be connected to southwest's onboard wifi + _param = "fill this in" + data = request.request("https://getconnected.southwestwifi.com/fp3d_fcgi-php/portal/public/index.php?_url=/index/getFile&path=last&_=" + _param) + data = json.loads(data[1]) + print("-- Update --") + print("Nautical Miles: " + str(data["distanceToDestinationNauticalMiles"])) + print("Phase: " + data["presentPhase"]) + print("Speed: " + str(data["groundSpeedKnots"]) + "kts") + seconds = data['timeToDestination'] + minutes = math.floor(seconds / 60) + seconds = seconds % 60 + print("Minutes: " + str(minutes) + " Seconds: " + str(seconds)) + print("Flight Number: " + data["flightNumber"] + " Registration: " + data["tailNumber"]) + + time.sleep(3) + print('\033[H\033[2J')