Created
June 24, 2019 13:57
-
-
Save pixmin/d6ecf4a85d54d24b11071605a469a7b6 to your computer and use it in GitHub Desktop.
BMS - Check if the PHP RFC page changed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /volumes/users/gaetan.priour/Documents/CheckPHPRFC | |
DATE=`date +"%Y%m%d %H%M"` | |
# Remove all but the last two | |
/bin/ls -1tr rfc* | /usr/bin/head -n -2 | /usr/bin/xargs -d '\n' rm -f -- | |
# Get the page | |
/usr/bin/wget --quiet https://wiki.php.net/rfc | |
# Compare the last two versions | |
LAST_TWO=`/bin/ls -1tr rfc* | /usr/bin/tail -2` | |
#echo -e "Comparing: $LAST_TWO" | |
# Lines starting by either > (added) or < (removed) | |
DIFF=`diff $LAST_TWO | /bin/grep -v "indexer" | /usr/bin/awk '/^([<>])/' ` | |
if [ ! -z "$DIFF" ]; then | |
echo -e "\n -- $DATE -- \n" >> diff.txt | |
echo -e "$DIFF\n" >> diff.txt | |
#echo -e "Found diff: $DIFF" | |
#/usr/bin/notify-send "PHP RFC has been updated!" | |
#echo "PHP RFC has been updated!" | osd_cat -i 1200 -o 3 -d 300 & | |
#echo "We have differences" | |
#echo $DIFF | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment