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 git@gist.github.com: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
- TypeError: Object #<NodeList> has no method 'forEach' in javascript?
- JSON parsing with ruby one-liner ?
- Native JS like jQuery
- URL scrapping with javascript
- Download images with node.js
- TypeError: can't convert Regexp into String
- One click duckduckgo
- Comparing Strings with variable white spacing
- Watir Webdriver attach window
- Remotely enable remote desktop on Debian