summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2020-11-30 16:26:57 +0100
committerGuillermo Ramos2020-11-30 16:26:57 +0100
commitbb10bd4c3c123d3b328b59419c67237429f8e485 (patch)
treee3071ffdb9d68bd6b8add300ee28266df369c151
parent27a40ff19edc8bdefd88fec581edaa116cb42254 (diff)
downloadbots-bb10bd4c3c123d3b328b59419c67237429f8e485.tar.gz
+ angel.sh (informativo matinal)
-rw-r--r--.gitignore1
-rwxr-xr-xangel.sh13
2 files changed, 14 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index c97f963..fc04139 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.sh
+!angel.sh
diff --git a/angel.sh b/angel.sh
new file mode 100755
index 0000000..1a353fa
--- /dev/null
+++ b/angel.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+TODAY=$(date '+%d/%m/%y')
+VIDEO_ID=$(
+ curl -s https://www.youtube.com/playlist\?list\=PLtk0IJ09y34XS044BgNOsFvd8FD4mPYQY \
+ | sed -n '/var ytInitialData/ { s/^.*ytInitialData = //; s/;.*$//; p }' \
+ | jq -r ".contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].playlistVideoListRenderer.contents[] | select(.playlistVideoRenderer.title.runs[0].text == \"Informativo matinal express [$TODAY]\") | .playlistVideoRenderer.videoId")
+
+if [ -z "$VIDEO_ID" ]; then
+ exit 0
+fi
+
+echo -e "Informativo matinal para ahorraros tiempo [$TODAY]\nhttps://www.youtube.com/watch?v=$VIDEO_ID"