Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed gxpr

thanks @magus
  • Loading branch information...
commit ba9efd3d3073314d52d891e9f32b2ca6d26d5d3a 1 parent 26c6769
@pengwynn authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 bin/gxpr
View
8 bin/gxpr
@@ -31,11 +31,9 @@ EXPR=$(echo "$@" | sed -e 's/+/%2B/g' -e 's/ /+/g')
res=$(
$CURL "$SEARCH?q=$EXPR" |
- grep '<h2 class=r' |
- perl -pe 's@.*<h2 class=r.*?<b>.*?= (.*?)</b>.*@\1@' |
- perl -pe 's@\x{a0}@@g' |
- perl -pe 's@ </font>@@g' |
- perl -pe 's@<.*?>@@g'
+ perl -ne '/<h2 class="r".*?>(.*)<\/h2>/ and print $1' |
+ perl -ne '/= (.*)/ and print $1' |
+ perl -pe 's/[^\x00-\x7F]//g'
)
# if we don't have a result, assume it's an invalid expression
Please sign in to comment.
Something went wrong with that request. Please try again.