Google sunrise sunset from terminal
As Google starts Sunrise and Sunset query, i tried these silly bash functions, make it more better.
Prerequisites: curl,html2text
sudo apt-get install curl html2text
$ git clone [email protected]:456310.git and edit.
function sunrise() { curl -sA Mozilla http://www.google.com/search?q=sunrise+$1 \ | html2text -width 80 \ | sed -n '10s/^ \{45\}//p';} function sunset() { curl -sA Mozilla http://www.google.com/search?q=sunset+$1 \ | html2text -width 80 \ | sed -n '/from now/s/^ \{44\}//p'; }
Paste the above code in your ~/.bashrc or anywhere accessible
Example usage:
hemanth@ubuntu:/tmp$ sunrise bangalore 3 hours 44 minutes from now hemanth@ubuntu:/tmp$ sunset bangalore 16 hours 37 minutes from now
Do comment you suggestions below
Recent blog posts
- watir-webdriver web inspector
- gem list to gemfile
- Packing ruby2.0 on debian.
- Made it into The Guinness Book!
- to_h in ruby 2.0
- Filter elements by pattern jQuery.
- Better HTML password fields for mobile ?
- Grayscale image when user offline
- nth-child CSS pseudo-class Christmas colors
- EventEmitter in nodejs