Coder Social home page Coder Social logo

TODO list about googler HOT 62 CLOSED

jarun avatar jarun commented on May 20, 2024 1
TODO list

from googler.

Comments (62)

c7n0 avatar c7n0 commented on May 20, 2024 3

It would be very nice to use Vim key bindings, for search, up/down navigation, copy etc.

from googler.

abhayghatpande avatar abhayghatpande commented on May 20, 2024 1

Is there anyway to avoid scrolling to the bottom of the search results? Something like less? It will avoid having to page up, to read the first few results. I observe this behaviour on OS X, not sure if it is applicable for Linux given some of the screenshots I see.

from googler.

jarun avatar jarun commented on May 20, 2024 1

You'll find the scripts in https://github.com/jarun/googler/tree/master/auto-completion

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Several ideas, all of which should be almost backwards compatible, but when implemented should be more user-friendly going forward:

  1. Toggling of options in the prompt (mentioned this before somewhere)?

  2. I would also like to support long command names so that commands are not so abstract to new users, especially the kind of new users who have little experience with REPL-styled utilities in general (not sure if this type of users are actually in our target audience, but it doesn't hurt). Examples:

    n(ext)
        navigate to the next page
    p(revious)
        navigate to the previous page
    o(pen) [INDEX]
        open the result corresponding to INDEX in the browser (open the
        current search instead if INDEX is omitted)
    f(irst)
        jump to the first page
    g(oogle) KEYWORD [KEYWORD...]
        initiate a new search for the given keywords with the original
        options
    e(xit), q(uit), double <ENTER>
        exit gooogler
    ?, h(elp)
        show omniprompt help
    INDEX
        equivalent to open INDEX
    KEYWORD [KEYWORD...]
        equivalent to google KEYWORD [KEYWORD...]
    
  3. Completion (using readline) for 1 and 2.

  4. googler without arguments enter the REPL instead of printing usage and exit. I always felt a bit weird that we have an interactive interface but users need to do at least one query noninteractively (by which I mean in command line args) to access it. It's like a Google that's only accessible through either Chrome's omnibox or the search bar of an ongoing query, but not from the google.com splash page.

    We can add a --help option for help text (standard anyway), and disable n, p, and f if there's no existing query.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

A bit of clarification on long command names that I forgot to mention: I personally like the type of interfaces where users should be able to enter a partial command as long as it is unambiguous, e.g., n, ne, nex, next all work as the next command. Same for options.

We could also give the interactive part of our program an OO interface, reminiscent of cmd.Cmd from PSL. We might even be able to just extend cmd.Cmd, which is not powerful enough yet, especially if we want to support options.

from googler.

jarun avatar jarun commented on May 20, 2024
  1. Toggling of options in the prompt (mentioned this before somewhere)?

At this time we don't have any other than filter. I'm good but I think it'll work differently for different for different options.

The rest of the ideas are very useful. 👍

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

At this time we don't have any other than filter. I'm good but I think it'll work differently for different for different options.

I mean real options like --time. Of course, only a subset of options should work in the prompt (excluded ones are --json, --colors, --tld and such). We'll also need --no* counterparts to some options.

from googler.

jarun avatar jarun commented on May 20, 2024

👍

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Note to self: our URL construction could receive an OO refresh too to make some points above easier and avoid awkward and brittle URL updating code like

url = url.replace('start=%d&' % oldstart, 'start=%d&' % start, 1)

I'll do this and point 4 in #87 (comment) tonight.

from googler.

jarun avatar jarun commented on May 20, 2024

👍

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

By the way, is "Document APIs in NumPy format [owner @jarun]" considered done?

from googler.

jarun avatar jarun commented on May 20, 2024

Yes, I think we can close it. Most important functions are covered.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Checked off. Don't want to create an "archive" entry anymore. Just remove checked off items when we roll the thread.

from googler.

jarun avatar jarun commented on May 20, 2024

We can remove the item.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

I think we can leave it checked off. It gives off a sense of accomplishment... And It will disappear the next time we roll the thread anyway, so it won't get in the way for long.

from googler.

jarun avatar jarun commented on May 20, 2024

👍
I guess you should add all the items you identified.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Added (sort of).

from googler.

jarun avatar jarun commented on May 20, 2024

okies :)

from googler.

jerkovicl avatar jerkovicl commented on May 20, 2024

is it possible to make it available to install via pip?

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

@jerkovicl No. See #64.

from googler.

dufferzafar avatar dufferzafar commented on May 20, 2024

Adding a setup.py doesn't really mean that you have to upload this to PyPI. It will also allow you to do this: pip install git+https://github.com/jarun/googler.git/#egg=googler (I think)

People just want pip because that's what they're comfortable using and I really think you should considering adding support for it. There's also magical things like pipsi.

from googler.

jarun avatar jarun commented on May 20, 2024

Given the utility is a standalone one (given base Python3 is installed), probably it doesn't matter anymore. We have no further plans on this line.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Adding a setup.py doesn't really mean that you have to upload this to PyPI. It will also allow you to do this: pip install git+https://github.com/jarun/googler.git/#egg=googler

Except it's overkill and doesn't work with older pip. Moreover, IIRC updating a git head package from within pip is a nightmare.

Just do this: https://github.com/jarun/googler#downloading-a-single-file.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Automatic scrolling is done by the terminal emulator, there's nothing we can do about it. We certainly can't bundle a curses TUI. However, if you submit a PR that implements optional piping through a pager, we could review it.

A workaround is to set the number of results per page to something suitable to your screen.

from googler.

abhayghatpande avatar abhayghatpande commented on May 20, 2024

Fair enough. Will look into it. Thanks for the immediate response.

from googler.

jarun avatar jarun commented on May 20, 2024

The workflow remains the same with the pager or limiting the number of results per page. Whether you page through (using Enter hopefully) 4 results per page or press n to fetch the next 4 results (using -n 4) I don't see much difference.

from googler.

knkarthik avatar knkarthik commented on May 20, 2024

#109 Doesn't actully fix the following, right?

googler without arguments enter the REPL instead of printing usage and exit. I always felt a bit weird that we have an interactive interface but users need to do at least one query noninteractively (by which I mean in command line args) to access it. It's like a Google that's only accessible through either Chrome's omnibox or the search bar of an ongoing query, but not from the google.com splash page.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

@knkarthik Please be more specific. What are you trying to do that's not possible?

from googler.

knkarthik avatar knkarthik commented on May 20, 2024

Sorry. What I meant is googler without arguments still enters the REPL instead of printing usage and exit. I thought #109 fixed this.

from googler.

jarun avatar jarun commented on May 20, 2024

What I meant is googler without arguments still enters the REPL instead of printing usage and exit.

That's the behaviour introduced by #109. Earlier googler used to show help and exit if no arguments were passed.

from googler.

knkarthik avatar knkarthik commented on May 20, 2024

Oh! Thanks for the clarification.

from googler.

jarun avatar jarun commented on May 20, 2024

No problem!

from googler.

jarun avatar jarun commented on May 20, 2024

No plans. We've kind of entered a maintenance-only phase. Sorry!

from googler.

 avatar commented on May 20, 2024

I was wondering if anyone was interested in adding bs4 based parsers for popular websites, that will parse things like Wikis, forums and stackexchange etc to make them work well on w3m/elinks.

from googler.

jarun avatar jarun commented on May 20, 2024

No plans as of now as

  1. we didn't find too many users who are using terminal based browsers with googler. The first issue was reported more than a yr after googler was revamped.
  2. we are sort of into a maintenance phase other than fixing issues.

@zmwangx, what do you think?

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

adding bs4 based parsers for popular websites, that will parse things like Wikis, forums and stackexchange etc to make them work well on w3m/elinks.

I don't see how that's related to googler at all. You should start your own project for that.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

I'll add that there are already a good number of popular article/full text/whatever extractors in Python.

from googler.

jorgesumle avatar jorgesumle commented on May 20, 2024

I was wondering if anyone was interested in adding bs4 based parsers for popular websites, that will parse things like Wikis, forums and stackexchange etc to make them work well on w3m/elinks.

That's what things like RSS and Atom is for. Just ask those popular websites, comment systems, whatever... to implement RSS, so that you can easily access their contents/updates, it is not very difficult to implement. If they make browsing difficult, then they don't probably want you to do that. But if that's the case, then you must boycott them or webscrap their website to regain your freedom. I'd help you if you want to do that for a company that fights against our freedom, such as Google, and if I'd find that useful, or if you are willing to pay me for the job.

Fight against DRM. Some anti-DRM websites:

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

@jorgesumle This is an entirely out of touch and out of place rant. First, websites have every right to their content, and user-generated content with rights signed away; you'd be a fool to think you should have "freedom" over someone else's work, if they don't grant it to you. Secondly, websites have absolutely zero obligation to make their websites work well in a text-based browser; graceful degradation / progressive enhancement sure is nice, but people need to be payed to do extra work. Thirdly, you're probably misinterpreting DRM (say, in the form of Encrypted Media Extensions); writing badly structured HTML that's hard to parse has nothing to do with DRM. I get that you're probably frustrated by recent developments in DRM on the web, but it has nothing to do with what @aditya3098 requested. So please stop.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

I'll also mention that both MediaWiki and StackExchange have APIs that grant you access to their native markup (Wiki markup and Markdown, respectively).

from googler.

vviikk avatar vviikk commented on May 20, 2024

This might be far reaching and also sound like I'm nuts. I use Fish shell that gives be CLI auto completion, and sometimes things like git checkouttab would do a quick fetch and list me all the branches. Would be so nice if we could have something similar for googler!. Love it anyway. Thanks.

from googler.

vviikk avatar vviikk commented on May 20, 2024

oooh. And also if we google "USD45 in GBP" it will convert currencies. Hope we can have this in googler. Even complex calculations is calculated by google.

from googler.

vviikk avatar vviikk commented on May 20, 2024

@jarun But isn't that just for the options? Does it return search results?

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

convert currencies

We decided that's out of scope for googler. See #97.

from googler.

jarun avatar jarun commented on May 20, 2024

Aah, you are looking for auto-completion search completion. Nope, we don't have it.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

@piggyslasher

search completion

Search completion API is actually pretty simple:

$ curl 'https://www.google.com/complete/search?client=psy-ab&q=git'
["git",[["git\u003cb\u003ehub\u003c\/b\u003e",0],["git",0],["git\u003cb\u003elab\u003c\/b\u003e",0],["git\u003cb\u003e stash\u003c\/b\u003e",0]],{"q":"THnbq2A3yeMOKRqVYkA-eHqtIek","t":{"bpc":false,"tlw":false}}]
$ curl 'https://www.google.com/complete/search?client=psy-ab&q=goo'
["goo",[["goo\u003cb\u003egle\u003c\/b\u003e",0,[131]],["goo\u003cb\u003egle maps\u003c\/b\u003e",0,[131]],["goo\u003cb\u003egle translate\u003c\/b\u003e",0],["goo\u003cb\u003egle docs\u003c\/b\u003e",0]],{"q":"A7UvvlTFeq-jF_cJ1aNpcm8BByY","t":{"bpc":false,"tlw":false}}]

Those strings of interest, translated to human-readable form, are:

  • git<b>hub</b>, git<b>lab</b>, git<b> stash</b>;
  • goo<b>gle</b>, goo<b>gle maps</b>, goo<b>gle translate</b>, goo<b>gle docs</b>.

You should be able to parse these with ease, and write a completer based on that. As for myself, I'm afraid I'm not motivated enough to implement this, but it does look like an interesting weekend hack.

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

Actually, since this is both simple and interesting, I just went ahead and did it. @piggyslasher If you're a Zsh user, you can go ahead and try the topic branch https://github.com/zmwangx/googler/tree/complete-queries. There's an additional script to install; see notes in https://github.com/zmwangx/googler/tree/complete-queries#shell-completion. I may add bash support later.

Anyway, here's a screencast. Pretty cool.

asciicast

@jarun Feel like ever including this feature on master? If so, I'll integrate this into googler itself (put this behind a hidden option, say --complete-query), and add bash and possibly fish support.

from googler.

jarun avatar jarun commented on May 20, 2024

@zmwangx I will check this. Need a few days. Thanks for checking it out!

from googler.

vviikk avatar vviikk commented on May 20, 2024

from googler.

jarun avatar jarun commented on May 20, 2024

@piggyslasher I use fish ;). Care to translate it to fish and submit a PR?

from googler.

zmwangx avatar zmwangx commented on May 20, 2024

@jarun Sounds like you approve of this idea? I learned some fish and added support to the same branch: https://github.com/zmwangx/googler/tree/complete-queries. I also integrated the completer into googler itself (a hidden option --complete) so there's no separate script to install. Screencast (fish version):

asciicast

from googler.

jarun avatar jarun commented on May 20, 2024

Sure I approve! I am not just finding time to get back to my usual stuff. Killer schedule... but I will be back.

Please raise the PR. It's extremely useful.

from googler.

vviikk avatar vviikk commented on May 20, 2024

Dayum.... This is wicked. Thanks guys. Let me try if it works with the zsh-autosuggestions. That would pretty much make it work like the chrome address bar!

from googler.

vviikk avatar vviikk commented on May 20, 2024

@jarun was troubleshooting a bash script I was writing, and it's almost the end of the road for me with fish shell sadly. I am giving zsh one more try and so far, I've been pleasantly impressed. Will try to see if I can get live auto completion to work with zsh-autosuggestions.

from googler.

ashutoshmjain avatar ashutoshmjain commented on May 20, 2024

selecting index is not opening in browser .. Is there an .googerrc file where I need to define the browser ?

Figured it out .. I exported links ..

Thanks

from googler.

jarun avatar jarun commented on May 20, 2024

No config file. You can use the env variable BROWSER. What's your browser? Is it set as your system default browser?

from googler.

nathan-b avatar nathan-b commented on May 20, 2024

I hope this is the right place to add a feature request...if not I can open a new issue!

I'd love a command line option to just return the number of results for a query. For instance:

$ googler --count --exact --np foo
92,500,000
$

from googler.

jarun avatar jarun commented on May 20, 2024

@nathan-b please refer to #144.

from googler.

xulayen avatar xulayen commented on May 20, 2024

在windows上上面可以安装使用吗

from googler.

xulayen avatar xulayen commented on May 20, 2024

how can i user googler on windows paltform ?

from googler.

jarun avatar jarun commented on May 20, 2024

Install Python and invoke googler. Use option -C if you are using cmd.

from googler.

jarun avatar jarun commented on May 20, 2024

Rolled at #209.

from googler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.