Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modi/eww-im-feeling-lucky can be improved #29

Open
beacoder opened this issue Nov 22, 2017 · 0 comments
Open

modi/eww-im-feeling-lucky can be improved #29

beacoder opened this issue Nov 22, 2017 · 0 comments

Comments

@beacoder
Copy link

beacoder commented Nov 22, 2017

;; I'm-feeling-lucky
(defun eww-im-feeling-lucky (search-term)
"Google I'm feeling lucky."
(interactive (list (smart/read-from-minibuffer "Google Search Term (I'm Feeling Lucky!)")))
;; Keep on burying the current buffer if it turns out to be an eww buffer.
(while (string-match "^eww$\|^eww<[[:digit:]]+>$" (buffer-name))
(bury-buffer))
;; Start a new eww search.
(eww search-term)
(sleep-for 0.1)
;; https://stackoverflow.com/questions/16877882/how-to-access-google-search-im-feeling-lucky-functionality-using-api
(eww-browse-url (concat (eww-current-url) "&btnI")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant