justapeon Posted December 5, 2013 Share Posted December 5, 2013 New Episode: ################################################################# New hak5 episode?#file1=hak5episodesfile2=hak5episodesoldcp $file1 $file2elinks "revision3.com/hak5/episodes" > $file1# diff_file=diffed# diff $file1 $file2 | grep "<" | sed 's/^<//g' > $diff_file# cat diff_fileI=`wc -c $file1 | cut -d' ' -f1`J=`wc -c $file2 | cut -d' ' -f1`if [ $I -ne $J ]then echo new episode echo new episode at $date > hak5lastupdateelse echo no new episodefi List recent episodes: ##################################### Latest Hak5 episodes##===============================# Assignments# --------------------------------datafile="hak5episodes"a=1flag=0# end assignments#=================================## Get data file#--------------------------------- elinks "revision3.com/hak5/episodes" > $datafile#=================================## Extract and display data#---------------------------------while read linedo fdata[$a]=$line echo $line | grep -q "All Episodes" if [ $? -eq 0 ]; then # header clear echo echo ------------------------------------------------ echo Recent Hak5 episodes echo ------------------------------------------------ echo "" let "flag = 1" fi echo $line | grep -q "Load More" if [ $? -eq 0 ]; then let "flag = 0" else if [ $flag -eq 1 ] ; then echo $line | sed 's/\[.*\]//' | sed 's/\Hak5//' fi filet "a += 1"done < $datafile# footerecho ---------------------------------------------echo#===================================# End.#################################### Quote Link to comment Share on other sites More sharing options...
newbi3 Posted December 6, 2013 Share Posted December 6, 2013 Protip: use code wrappers it makes everything much easier to read! Oh and nice scripts! Quote Link to comment Share on other sites More sharing options...
justapeon Posted January 3, 2014 Author Share Posted January 3, 2014 echo new episode at $date > hak5lastupdate s/b echo new episode at $(date) > hak5lastupdate Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.