Added Costco fuel price check function to .aliases and updated .profile

This commit is contained in:
Phil 2022-12-15 17:06:14 +00:00
parent bdc2f55245
commit 58e96b4233
2 changed files with 18 additions and 1 deletions

View File

@ -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"
}

View File

@ -22,4 +22,5 @@ if [ -n "$BASH_VERSION" ]; then
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export PATH="$PATH:$HOME/opt/esp/xtensa-lx106-elf/bin"
export IDF_PATH="/opt/esp/ESP8266_RTOS_SDK"