Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/newlisp
- # gcount - google count
- # (code taken from the www.newlisp.org website)
- (set 'pattern "(?i)about\\s*([\\d,]+)\\s*results")
- (define (hits str)
- (regex pattern (get-url
- (string "http://www.google.com/search?hl=en&q=" (replace " " str "+"))))
- (string $1))
- (dolist (str (2 (main-args)))
- (println (format "%s -> %s" str (set 'hts (hits str))))
- (push (int (replace "," hts "")) lst))
- (if (= (length lst) 2)
- (println (format "ratio: %.2f:1" (div (lst 1) (lst 0)))))
- (exit)
Add Comment
Please, Sign In to add comment