爱意满满的作品展示区。
shispt

whats - 命令行中 Google 搜索,打印第一条结果的正文

  •  
  •   shispt · Jun 9, 2017 · 3019 views
    This topic created in 3297 days ago, the information mentioned may be changed or developed.
    https://github.com/shispt/whats
    主要功能就是在命令行 Google 搜索关键词,打印第一条结果正文;
    部分参考 https://github.com/gleitz/howdoi ,以后可能会添加支持代理,多个搜索引擎之类。
    11 replies    2017-06-20 00:43:17 +08:00
    run2
        1
    run2  
       Jun 10, 2017
    https://github.com/jarun/googler
    话说怎么都 python 的,那么“一堆”依赖看这不爽

    有高手来个 go 的么? 可以直接 go get 多爽
    run2
        2
    run2  
       Jun 10, 2017
    不懂 golang 的情况下,搜索着改的
    https://github.com/ryh/gosearch
    go get -u github.com/ryh/gosearch/cmd/gos
    Aar0nFr4nk
        3
    Aar0nFr4nk  
       Jun 11, 2017
    感觉这个毫无用处...
    shispt
        4
    shispt  
    OP
       Jun 12, 2017
    xiaozizayang
        5
    xiaozizayang  
       Jun 12, 2017
    @Aar0nFr4nk 用处是有的 问题是在连续搜索的情况下尽可能解决 302
    Aar0nFr4nk
        6
    Aar0nFr4nk  
       Jun 12, 2017
    @shispt
    @xiaozizayang
    如果只是打印第一条结果 我倒是觉得真心意义不大 搜索一个关键字第一条结果就能有解决方案的 我平时碰到很少...另外也就是 302 问题...这样倒不如 proxychains4 python -c "import urllib2,re;#re.finall(r'xxx',HTML)[0]" 然后添加个 alias 省力..
    mingyun
        7
    mingyun  
       Jun 12, 2017
    $ python setup.py install
    Traceback (most recent call last):
    File "setup.py", line 37, in <module>
    """ % read('README', 'CHANGES')
    File "setup.py", line 24, in read
    value = open(name + extension).read()
    UnicodeDecodeError: 'gbk' codec can't decode byte 0x8c in position 123: illegal
    multibyte sequence

    为什么不上传 pypi 方便安装呢?
    kzzhr
        8
    kzzhr  
       Jun 13, 2017 via iPhone   ❤️ 1
    如果能和 alfred 结合起来就爽了。
    shispt
        9
    shispt  
    OP
       Jun 13, 2017
    @mingyun 上传到 pypi 了,试试 `pip install whats` 能不能安装
    mingyun
        10
    mingyun  
       Jun 13, 2017
    @shispt thks 安装成功了,但是报错了
    from urllib import quote as url_quote
    ImportError: cannot import name 'quote'

    还有 ss 翻墙了,但是命令行没法翻,怎么破
    shispt
        11
    shispt  
    OP
       Jun 20, 2017
    @mingyun python3 的问题,执行 `pip install -U whats` 试试?

    代理可以设置环境变量:

    `export http_proxy='socks5h://127.0.0.1:1080'`
    `export https_proxy='socks5h://127.0.0.1:1080'`

    然后再使用就会走代理。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1590 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 16:18 · PVG 00:18 · LAX 09:18 · JFK 12:18
    ♥ Do have faith in what you're doing.