By the way here's a more robust version with proper quoting and supporting multiple arguments:
``` sh
#!/bin/sh
for keyword; do
safe_keyword="$(python3 -c 'import urllib.parse, sys; print(urllib.parse.quote_plus(sys.argv[1]))' \""$keyword"\")"
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" -sSL "https://www.google.com/search?q=$safe_keyword" | grep -Po "(?<=About )[0-9,]+(?= results)" | tr -d ,
done
```
```
$ ./google-result-count google apple microsoft 'western digital'
10770000000
2170000000
1100000000
20200000
```
I recall thinking about this and decided it was not worth the complexity.
> I'm often using it to define how popular a brand is.
Instead of requesting a feature from googler then parsing it from googler's output, here's a much simpler and much more direct approach — a one-liner shell script (assuming English language and GNU grep; easy to adapt otherwise):
``` sh
$ cat google-result-count
#!/bin/sh
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36" -sSL "https://www.google.com/search?q=$1" | grep -Po "(?<=About )[0-9,]+(?= results)" | tr -d ,
$ ./google-result-count google
10520000000
$ ./google-result-count apple
2120000000
$ ./google-result-count microsoft
1080000000
```
Feel free to contribute the feature though.
bump-formula-pr: add --message option
=====================================
- [x] Have you followed the guidelines in our [Contributing](https://github.com/Homebrew/brew/blob/master/CONTRIBUTING.md) document?
- [x] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/Homebrew/brew/pulls) for the same change?
- [x] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your changes? [Here's an example](https://github.com/Homebrew/homebrew/pull/49031).
- [ ] Have you successfully run `brew tests` with your changes locally?
-----
Add a `--message=<message>` option to `bump-formula-pr` so that user can supply a piece of message to be included in the PR message.
The motivation comes from automatically bumping `imagemagick`. I have a script to do it, but I want to include a reminder to maintainers:
> Please remember to
> ```
> brew mirror imagemagick
> ```
> when merging.
Since `brew-bump-formula-pr` doesn't allow custom PR message, I have to copy the message to clipboard at the end of the script, and remember to paste that into a comment when the PR has been created. I'd like to be able to do
```
brew bump-formula-pr --url=https://dl.bintray.com/homebrew/mirror/imagemagick-6.0.0-0.tar.xz --mirror=https://www.imagemagick.org/download/ImageMagick-6.0.0-0.tar.xz --sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 --message=$'Please remember to\n```\nbrew mirror imagemagick\n```\nwhen merging.' imagemagick
```
and forget about it.
I understand that this is a niche feature, but `bump-formula-pr` is a very niche dev cmd to begin with, so I figured it doesn't hurt to suggest this.