aboutsummaryrefslogtreecommitdiff
path: root/rdt
diff options
context:
space:
mode:
Diffstat (limited to 'rdt')
-rwxr-xr-xrdt11
1 files changed, 11 insertions, 0 deletions
diff --git a/rdt b/rdt
new file mode 100755
index 0000000..986f142
--- /dev/null
+++ b/rdt
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Get the titles of posts in a given subreddit (defaults to /r/all)
+curl -A Mozilla https://reddit.com/r/"${1:-all}"/"${2:+"$2"/}".compact |
+pup -p 'p.title > a' 'json{}' |
+jq -M -r '.[] | .text,.href' |
+sed '
+/^http/{
+ s/^/ </
+ s/$/>/
+}
+'