Couple of bash scripts

-----------------------------------------------------------------
Simple bash scripts for NFL football.
------------------------------------------------
nfl data for phase = 2 week = 14 season = 2013
------------------------------------------------
Home           Score              Away
Thursday, December 5
Houston 20 - 27 Jacksonville Final
Sunday, December 8
Minnesota 26 - 29 Baltimore Final
Kansas City 45 - 10 Washington Final
Buffalo 6 - 27 Tampa Bay Final
Miami 34 - 28 Pittsburgh Final
Detroit 20 - 34 Philadelphia Final
Oakland 27 - 37 NY Jets Final
Cleveland 26 - 27 New England Final
Atlanta 21 - 22 Green Bay Final
Indianapolis 28 - 42 Cincinnati Final
Tennessee 28 - 51 Denver Final
Seattle 17 - 19 San Francisco Final
NY Giants 14 - 37 San Diego Final
St. Louis 10 - 30 Arizona Final
Carolina 13 - 31 New Orleans Final
Monday, December 9
Dallas 28 - 45 Chicago Final
---------------------------------------------
Script 1:
####################################
# Score  Grabber
#
#===============================
# Assignments
# --------------------------------
datafile="nflscorefile"
a=1
flag=0
week=14
# phase 1 is preseason phase 2 is regular season phase 3 is
phase=2
season=2013
#finished week = 1 unfinished week = 0
weekfinished=1
league="nfl"
# end assignments
#=================================
#
# Get data file
#---------------------------------
case $weekfinished in
1)
elinks "http://sports.yahoo.com/$league/scoreboard/?week=$week&phase=$phase&season=$season"  > $datafile
;;
0)
elinks "http://sports.yahoo.com/$league/scoreboard/"  > $datafile
;;
*)
#
;;
esac
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "Home Score Away"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  $league  data for phase = $phase  week = $week  season = $season
echo ------------------------------------------------
echo
echo "       Home           Score              Away"
echo ""
let "flag = 1"
fi
if [ $flag -eq 1 ]; then
echo $line | grep -q "Latest NFL Videos"
if [ $? -eq 0 ]; then
let "flag = 0"
else
echo $line | grep -q "Home Score Away"
if  [ $? -ne 0 ]; then
case $weekfinished in
1)
echo $line | sed 's/\[.*\]//'
;;
0)
echo $line
;;
*)
#
;;
esac
fi
fi
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===============================
# End.
####################################
------------------------------------------------
NFL schedule for week: 15 of season = 2013
------------------------------------------------
Week 15
Thursday, Dec. 12
San Diego Chargers at Denver Broncos, 8:25
Sunday, Dec. 15
Washington Redskins at Atlanta Falcons, 1
Chicago Bears at Cleveland Browns, 1
Houston Texans at Indianapolis Colts, 1
Buffalo Bills at Jacksonville Jaguars, 1
New England Patriots at Miami Dolphins, 1
Philadelphia Eagles at Minnesota Vikings, 1
Seattle Seahawks at New York Giants, 1
New Orleans Saints at St. Louis Rams, 1
San Francisco 49ers at Tampa Bay Buccaneers, 1
Arizona Cardinals at Tennessee Titans, 1
New York Jets at Carolina Panthers, 4:05
Kansas City Chiefs at Oakland Raiders, 4:05
Green Bay Packers at Dallas Cowboys, 4:25
Cincinnati Bengals at Pittsburgh Steelers , 8:30*
Monday, Dec. 16
Baltimore Ravens at Detroit Lions, 8:40
---------------------------------------------
Script 2
####################################
# Nfl schedule  Grabber
#
#===============================
# Assignments
# --------------------------------
datafile="nflscorefile"
a=1
flag=0
week=15
# phase 1 is preseason phase 2 is regular season phase 3 is
phase=2
season=2013
# end assignments
#=================================
#
# Get data file
#---------------------------------
elinks www.usatoday.com/story/sports/nfl/2013/04/18/week-by-week-2013-nfl-schedule/2093613/ > $datafile
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "Week $week"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  NFL schedule for week: $week of season = $season
echo ------------------------------------------------
echo
let "flag = 1"
fi
let nextweek=$week+1
echo $line | grep -q "Week $nextweek"
if [ $? -eq 0 ]; then
let "flag = 0"
else
if [ $flag -eq  1 ] ;  then
echo $line
fi
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===================================
# End.
####################################
------------------------------------------------------------------------------
Couple of dumb scripts  using Hak5.
Script 1
################################################################
#   New hak5 episode?
#
file1=hak5episodes
file2=hak5episodesold
cp $file1 $file2
elinks "revision3.com/hak5/episodes"  > $file1
# diff_file=diffed
# diff  $file1 $file2 | grep "<" | sed 's/^<//g' > $diff_file
# cat diff_file
I=`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) > hak5lastupdate
else
echo no new episode
fi
------------------------------------------------
Hak5 episodes
------------------------------------------------
All Episodes
* Point to Point Pineapple mesh continued. Decibels to Watts,
antenna polarization, "cable loss" and why HAMS get all the good...
Point to Point Pineapple Mesh Continued and Syncing with
GoodSync
* Learn the ins and outs of EIRP, 2.4 GHz and the legal way to
balance radio output with antenna gain. This episode is...
Legally build a 60 Watt WiFi Link - 2.4 GHz and EIRP
* This week we go behind the scenes at the  Studio during our
recent studio upgrades. Also Shannon explores some of the...
Upgrading the Studio and Chromecast Tricks
* This week Darren interviews Craig Heffner on his research in to
backdoors on routers. Also find Shannon dices into Seafile...
Discovering Hidden Backdoors In Home Routers And Storing Data With
Seafile
* Darren meets Paul McMillan to see the whole internets VNC servers
in 16 minutes. Also find new was to connect to your phone...
Hidden Device Inputs Revealed!
* Wireless Packet Sniffing!!! Tracking vehicle Tire Pressure Sensor
data with Jared Boone and open source software defined...
Tracking Cars Wirelessly And Intercepting Femtocell Traffic
* Exploring the software development for the castAR with Rick
Johnson. Also seeing the hardware side of castAR with Jeri...
Creating Virtual Worlds With castAR
* The new WiFi Pineapple Mark V is unveiled at this special
launch event featuring Darren, Sebastian, Eighty of Dual...
The New WiFi Pineapple Mark V
* Session Hijacking with Raphael Mudge of Armitage, Disk Forensic
from Raspberry Pi and Custom Hacker Linux Distros from...
Derbycon 2013 Continues and Enterprise Cloud Syncing
* This time on , Darren speaks with RenderMan at Derbycon 2013
on vulnerabilities in the nextgen Air Traffic Control...
Secure Messaging and Air Traffic Control Hacking
* Syncing files with BitTorrent Sync and alternative ways to Sneaker
Net files using optics and audio! All that and more, this...
Alternative Sneaker Nets and BitTorrent Syncing
* Cheap Kali Linux Laptop with a Raspberry Pi, a Lapdock and Custom
Cables - Shannon Morse reports. Then, Persistently...
Kali Linux Raspberry Pi Laptop and Hijack Windows Password
* The latest NSA leaks outline a massive program against internet
encryption. What is safe anymore? Can you trust PGP? How do...
Setup Your Own Private Cloud and Air Gaps
* Cracking Windows passwords in 15 seconds or less with a special
USB Rubber Ducky firmware and mimikatz. Build your own...
Install OwnCloud and Cracking Passwords with a Rubber Ducky
* Windows exfiltration with a USB thumb drive and a USB Rubber
Ducky and Benchmarking Your Linux Systems. All that and more...
How to Benchmark Your Linux System And Exfiltration Ducky
Attacks
* Running the occasional Windows program with out cramping your
Linux lifestyle, Windows exfiltration with the USB Rubber...
What's Up with the Duck?
-------------------------------------
Script 2:
####################################
# Latest Hak5 episodes
#
#===============================
# Assignments
# --------------------------------
datafile="hak5episodes"
a=1
flag=0
# end assignments
#=================================
#
# Get data file
#---------------------------------
elinks "revision3.com/hak5/episodes"  > $datafile
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "All Episodes"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  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
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===================================
# End.
####################################
-----------------------------------------------------------------

Comments

Popular posts from this blog

Guiless?

Web.com and Network Solutions, the Walmart of the internet.

MSOffice vs Libreoffice