Added Costco fuel price check function to .aliases and updated .profile
This commit is contained in:
parent
bdc2f55245
commit
58e96b4233
16
.aliases
16
.aliases
@ -325,3 +325,19 @@ alias shell="cat /etc/shells"
|
||||
alias set-shell-bash="chsh -s /usr/bin/bash"
|
||||
alias set-shell-zsh="chsh -s /usr/bin/zsh"
|
||||
alias set-shell-tmux="chsh -s /usr/bin/tmux"
|
||||
|
||||
## Get Costco Fuel Price
|
||||
function costco-fuel-price {
|
||||
## Get website data with curl
|
||||
costco_gateshead_site=$(curl -s https://www.costco.co.uk/store-finder/Gateshead)
|
||||
|
||||
## Grep text from website for different fuel
|
||||
costco_diesel=$(echo $costco_gateshead_site | grep -oP '"gas-title">Premium Diesel</span></br> <span class="gas-price">\K.*' | grep -oE '^.{5}')
|
||||
costco_premium_unleaded=$(echo $costco_gateshead_site | grep -oP '"gas-title">Premium Unleaded Petrol</span></br> <span class="gas-price">\K.*' | grep -oE '^.{5}')
|
||||
costco_unleaded=$(echo $costco_gateshead_site | grep -oP '"gas-title">Unleaded Petrol</span></br> <span class="gas-price">\K.*' | grep -oE '^.{5}')
|
||||
|
||||
## Print fuel prices
|
||||
echo "Premium Diesel - $costco_diesel p"
|
||||
echo "Premium Unleaded - $premium_unleaded p"
|
||||
echo "Unleaded - $costco_unleaded p"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user