V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
xvid73
V2EX  ›  分享创造

v2ex_daily_mission v0.4.0 发布

  •  
  •   xvid73 ·
    lord63 · 2015-07-11 22:24:44 +08:00 · 4241 次点击
    这是一个创建于 3408 天前的主题,其中的信息可能已经有所发展或是发生改变。

    108 天之前,我发过一个帖子,介绍过 v2ex_daily_mission,其主要的用途就是签到领钱,帖子在这里 The first python package for V2EX -- v2ex_daily_mission

    那时候,v2ex_daily_mission 应该可是看作一个小脚本,一个小玩意,我之前是放在 a_bunch_of_code 的 repo 下的。

    现在,我想做的更多,我想把它做的更好,想让更多的 V 友用到它,想让它成为大家推荐的签到工具。我把它独立了出来,写了 tests,修改了挺多,现在它有点 project 的样子了。目前需要的是大家的使用反馈和意见建议,需要得到大家的注意。

    现在说说相比于之前发帖时的主要变动:

    • python 2.7+/3.3+ support,增加了 3.x 的支持
    • 支持 Linux/Windows。是的,开始对 windows 做支持,之前没有加是因为自己很少用,到时如果有问题可能我不能解决,但实际上对 windows 的支持比想象中简单。我在 win thin pc 下测试了使用没有问题,但这是初步的尝试,有问题请及时反馈,并不是很有信心
    • 重新使用 click 重写
    • 写了基础的测试,你也可以帮我改进 _(:3

    如果你是第一次看到这个帖子的,我再提提 v2ex_daily_mission 的主要功能:

    • 签到领钱
    • 本地日志记录和查询
    • 查询连续登录的天数

    最后讲讲你为什么可以试试 v2ex_daily_mission:

    • 以上提到的功能能够满足你
    • 安装升级方便: pip install v2ex_daily_mission
    • 我个人也在用,将近快一年了,在我用的未来期间内我会继续维护这个项目的

    如果你感觉还不错的话,说不定可以试试呢,一起让它变的更加好吧 ;)

    Github 地址: https://github.com/lord63/v2ex_daily_mission

    32 条回复    2016-04-23 23:33:25 +08:00
    xvid73
        1
    xvid73  
    OP
       2015-07-11 22:25:51 +08:00
    大家都在用什么签到工具呢,也可以交流交流呗。
    Septembers
        2
    Septembers  
       2015-07-11 22:35:45 +08:00
    l0wkey
        3
    l0wkey  
       2015-07-11 23:07:28 +08:00
    https://qiandao.today/
    Dk2014
        4
    Dk2014  
       2015-07-11 23:38:05 +08:00 via Android
    安装的时候好多错误→_→
    shinwood
        5
    shinwood  
       2015-07-11 23:47:08 +08:00
    已经手动连续签到了700多天了…

    不得不说我还真是坚持啊。
    sldaniel
        6
    sldaniel  
       2015-07-11 23:57:59 +08:00
    装的时候有错误。。不知道能用不
    Mutoo
        7
    Mutoo  
       2015-07-12 00:03:45 +08:00
    xiaozi
        8
    xiaozi  
       2015-07-12 00:48:43 +08:00
    手动签到,只为那份情怀
    mopvhs
        9
    mopvhs  
       2015-07-12 00:51:52 +08:00 via iPhone
    @xiaozi 天数一多就害怕失去了
    xvid73
        10
    xvid73  
    OP
       2015-07-12 08:26:50 +08:00
    @Dk2014 @sldaniel

    说明一下 Python 版本,系统版本,贴一下错误日志,让我看看是什么错误。
    Dk2014
        11
    Dk2014  
       2015-07-12 10:53:05 +08:00 via Android
    @xvid73 这里的错误日志是最后的那几行红字,还是完整的安装日志。
    sldaniel
        12
    sldaniel  
       2015-07-12 10:54:16 +08:00
    python是Python 2.7.6。 系統是DO的ubuntu 14.04
    root@test:~# pip install v2ex_daily_mission
    Downloading/unpacking v2ex-daily-mission
    Downloading v2ex_daily_mission-0.4.0.tar.gz
    Running setup.py (path:/tmp/pip_build_root/v2ex-daily-mission/setup.py) egg_info for package v2ex-daily-mission

    Requirement already satisfied (use --upgrade to upgrade): click in /usr/local/lib/python2.7/dist-packages (from v2ex-daily-mission)
    Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages (from v2ex-daily-mission)
    Downloading/unpacking lxml (from v2ex-daily-mission)
    Downloading lxml-3.4.4.tar.gz (3.5MB): 3.5MB downloaded
    Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
    warnings.warn(msg)
    Building lxml version 3.4.4.
    Building without Cython.
    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt

    warning: no previously-included files found matching '*.py'
    Installing collected packages: v2ex-daily-mission, lxml
    Running setup.py install for v2ex-daily-mission

    Installing v2ex script to /usr/local/bin
    Running setup.py install for lxml
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
    warnings.warn(msg)
    Building lxml version 3.4.4.
    Building without Cython.
    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    building 'lxml.etree' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
    src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: No such file or directory
    #include "pyconfig.h"
    ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xaaq5i-record/install-record.txt --single-version-externally-managed --compile:
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

    warnings.warn(msg)

    Building lxml version 3.4.4.

    Building without Cython.

    ERROR: /bin/sh: 1: xslt-config: not found



    ** make sure the development packages of libxml2 and libxslt are installed **



    Using build configuration of libxslt

    running install

    running build

    running build_py

    creating build

    creating build/lib.linux-x86_64-2.7

    creating build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/cssselect.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/builder.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/sax.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/__init__.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-2.7/lxml

    creating build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-2.7/lxml/includes

    creating build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/builder.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/defs.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/diff.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-2.7/lxml/html

    copying src/lxml/html/clean.py -> build/lib.linux-x86_64-2.7/lxml/html

    creating build/lib.linux-x86_64-2.7/lxml/isoschematron

    copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-2.7/lxml/isoschematron

    copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-2.7/lxml

    copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.7/lxml/includes

    copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-2.7/lxml/includes

    creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources

    creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/rng

    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/rng

    creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl

    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl

    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl

    creating build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

    running build_ext

    building 'lxml.etree' extension

    creating build/temp.linux-x86_64-2.7

    creating build/temp.linux-x86_64-2.7/src

    creating build/temp.linux-x86_64-2.7/src/lxml

    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w

    src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: No such file or directory

    #include "pyconfig.h"

    ^

    compilation terminated.

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
    Cleaning up...
    Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xaaq5i-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
    Storing debug log for failure in /root/.pip/pip.log

    @xvid73
    xvid73
        13
    xvid73  
    OP
       2015-07-12 14:19:06 +08:00
    @sldaniel 多谢反馈。从日志中可以看出,原因在于 lxml 库安装失败,一些 lxml 库依赖的东西你的系统上没有。你可以试试安装一下的包,看看问题是否解决:

    $ sudo apt-get install libxml2-dev libxslt1-dev python-dev

    另外符上几个参考链接,如果上面的方法失败的话,可以看看:

    * http://stackoverflow.com/q/4598229/4890577
    * http://stackoverflow.com/q/6504810/4890577
    * http://stackoverflow.com/q/5178416/4890577

    有问题请继续反馈给我。
    xvid73
        14
    xvid73  
    OP
       2015-07-12 14:22:06 +08:00
    @Dk2014 额,好像没有看到你贴的错误日志唉。贴一下你的安装时的错误日志吧,好让我知道问题在哪里。
    Dk2014
        15
    Dk2014  
       2015-07-12 17:11:55 +08:00 via Android
    @xvid73 和楼上的错误好像是一样的,系统是Ubuntu 14.10 x64
    Python 2.7.8
    xvid73
        16
    xvid73  
    OP
       2015-07-12 19:06:30 +08:00
    @Dk2014 好的,估计是 lxml 的问题,我在 13# 回复了解决方法,你试试,不行的话再反馈给我。
    sldaniel
        17
    sldaniel  
       2015-07-12 21:55:51 +08:00
    @xvid73 原来后面要加dev,我直接apt-get了一下缺的东西结果说都装了。。。
    xvid73
        18
    xvid73  
    OP
       2015-07-12 22:05:24 +08:00
    @sldaniel 那么现在能够正常使用了么?
    kcOolr9b716HNnrf
        19
    kcOolr9b716HNnrf  
       2015-07-13 10:08:25 +08:00
    是不是mac下不支持?
    Dk2014
        20
    Dk2014  
       2015-07-13 11:14:10 +08:00 via Android
    已解决
    apt-get install libxml2-dev libxslt1-dev python-dev

    这个装完之后还需要装这个

    apt-get install python-lxml

    使用easy_install lxml会报错

    最后pip install v2ex_daily_mission 成功
    xvid73
        21
    xvid73  
    OP
       2015-07-13 12:41:16 +08:00
    @yy910217 由于手头没有 mac,所以没有测试,不能保证正常使用。如果你有 mac 的话可以试试,然后跟我说说情况。
    kcOolr9b716HNnrf
        22
    kcOolr9b716HNnrf  
       2015-07-13 14:08:44 +08:00
    @xvid73 Can't find config file at /usr/local/bin/v2ex_config.json.
    mac下没有生成这个v2ex_config.json配置
    xvid73
        23
    xvid73  
    OP
       2015-07-13 17:09:51 +08:00
    @yy910217 那个配置文件是要你手动增加的嘛,具体参数设置看看 readme。能用告诉我下。
    fromshawn
        24
    fromshawn  
       2015-07-14 19:51:39 +08:00
    python2.6 CentOS
    运行 v2ex sign 提示
    AttributeError: 'module' object has no attribute 'disable_warnings'
    xvid73
        25
    xvid73  
    OP
       2015-07-14 20:09:06 +08:00
    @fromshawn 额,因为 2.6 有点老了,而且我手头也没有环境测试,所以在 v2ex_daily_mission 中 readme 中写到支持的有 2.7+,2.6 的没有保证。
    从你的错误提示中来看,应该是跟 requests 库有关,报一下你的 requests 库的版本。
    solupro
        26
    solupro  
       2015-07-15 09:28:13 +08:00
    已手动签到700+天,打算1000天的时候水一贴纪念
    xvid73
        27
    xvid73  
    OP
       2015-07-15 13:03:03 +08:00
    @solupro 就在前几天,我将近一年的签到断了 QAQ
    Ansen
        28
    Ansen  
       2016-04-22 09:55:20 +08:00
    今天报错了

    Traceback (most recent call last):
    File "/opt/v2ex/v2ex_daily_mission.py", line 43, in <module>
    short_url = make_soup(mission_url, 'class', 'super normal button')['onclick']
    File "/usr/lib/python2.7/dist-packages/bs4/element.py", line 879, in __getitem__
    return self.attrs[key]
    KeyError: 'onclick'
    xvid73
        29
    xvid73  
    OP
       2016-04-23 22:35:14 +08:00
    @Ansen 感谢反馈,尝试发布了 0.6.1 版本,你试试有没有修复这个问题。请继续反馈 :0
    Ansen
        30
    Ansen  
       2016-04-23 22:45:02 +08:00 via iPhone
    @xvid73 V2EX 登陆表单变了
    xvid73
        31
    xvid73  
    OP
       2016-04-23 22:53:36 +08:00   ❤️ 1
    @Ansen 0.6.1 还是不能正常签到么?
    Ansen
        32
    Ansen  
       2016-04-23 23:33:25 +08:00 via iPhone
    @xvid73 额 不知道 我的已经签过了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2570 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 15:32 · PVG 23:32 · LAX 07:32 · JFK 10:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.