mrneilypops

elegance-atomfeed.sh

Jan 10th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Script by damo
  4.  
  5. URL="https://forums.bunsenlabs.org/extern.php?action=feed&type=atom"
  6.  
  7. # comment out this loop if you aren't using NetworkManager
  8. while ! pidof nm-applet &>/dev/null;do
  9. exit
  10. done
  11.  
  12. # get the forum output:
  13. # extract text between "CDATA[" and "]]" (Post title text)
  14. # cut first line with tail
  15. # keep first 6 lines from result of tail
  16.  
  17. curl -s "$PWORD" "$URL" | grep "<title" | grep -o -P '(?<=CDATA\[).*(?=\]\])'| tail -n +2 | head -n 6
Advertisement
Add Comment
Please, Sign In to add comment