https://github.com/nickstenning/gc
A simple command line interface to the Google Calculator API
https://github.com/nickstenning/gc
Last synced: 6 months ago
JSON representation
A simple command line interface to the Google Calculator API
- Host: GitHub
- URL: https://github.com/nickstenning/gc
- Owner: nickstenning
- Created: 2011-01-10T11:37:01.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-05-31T19:47:51.000Z (about 15 years ago)
- Last Synced: 2025-07-07T21:40:53.198Z (about 1 year ago)
- Homepage:
- Size: 89.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gc
This is an extremely simple interface to the Google Calculator. Just pass it the query on the command line.
$ gc 2 + 2
4
$ gc -v 2 + 2
2 + 2 = 4
$ gc once in a blue moon
1.16699016 * 10^-8 hertz
$ gc "(4 * pi * epsilon_0 * hbar * c) / elementary charge^2"
137.035984
$ gc "sqrt((c * 8 minutes)^3 / (G * m_sun)) * 2 pi in years"
0.943428231 years
Alternatively you can use `gc` interactively:
$ gc
>> 1m / (2 second / 2 pi)^2
9.8696044 m / s^2
>> 4 pi * r_earth^2 in inverse barns
1.95617402 * 10^-43 inverse barns
**NB:** This is particularly nice when combined with [rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap.html), as `gc` has no readline support of its own.
## Why use gc?
The big difference between this and other projects such as [uj-gcalc](http://code.google.com/p/uj-gcalc/) is that it doesn't try and parse the results from the Google HTML results page, it extracts them directly from the Calculator API at , thus hopefully making it more resilient to the whims of Google's engineers.
If you come across any bugs, please [open an issue](https://github.com/nickstenning/gc/issues).