{"id":16554778,"url":"https://github.com/j178/fanfou-cli","last_synced_at":"2025-07-01T04:06:02.705Z","repository":{"id":57428380,"uuid":"76623864","full_name":"j178/fanfou-cli","owner":"j178","description":"饭否命令行客户端","archived":false,"fork":false,"pushed_at":"2017-06-09T07:37:24.000Z","size":1431,"stargazers_count":23,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T14:15:00.734Z","etag":null,"topics":["cli","network","social-network"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j178.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-16T05:19:32.000Z","updated_at":"2023-06-28T14:02:31.000Z","dependencies_parsed_at":"2022-09-02T15:31:32.924Z","dependency_job_id":null,"html_url":"https://github.com/j178/fanfou-cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/j178/fanfou-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Ffanfou-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Ffanfou-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Ffanfou-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Ffanfou-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j178","download_url":"https://codeload.github.com/j178/fanfou-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j178%2Ffanfou-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261595664,"owners_count":23182241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","network","social-network"],"created_at":"2024-10-11T19:52:20.695Z","updated_at":"2025-07-01T04:06:02.676Z","avatar_url":"https://github.com/j178.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"饭否命令行客户端\n################\n\n.. image:: https://travis-ci.org/j178/fanfou-cli.svg?branch=master\n    :target: https://travis-ci.org/j178/fanfou-cli\n\n.. image:: https://badge.fury.io/py/fanfou-cli.svg\n    :target: https://pypi.python.org/pypi/fanfou-cli\n\n.. image:: https://img.shields.io/badge/python-3.5-blue.svg\n    :target: https://pypi.python.org/pypi/fanfou-cli\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n    :target: https://pypi.python.org/pypi/fanfou-cli\n\n.. image:: https://badges.gitter.im/fanfou-cli2/Lobby.svg\n    :target: https://gitter.im/fanfou-cli2/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\n\n安装\n====\n\n- 通过 `pip`_ 安装\n\n.. code-block:: bash\n\n  pip3 install fanfou-cli\n\n- 手动安装\n\n.. code-block:: bash\n\n    git clone https://github.com/j178/fanfou-cli\n    cd fanfou-cli\n    pip3 install . --user\n\n使用\n====\n\n日常使用\n--------\n\n.. code-block:: bash\n\n    fan 任意文字，不需要引号，可以包含空格，fan命令之后的任意内容均被当作新饭的内容\n\n\n其他功能\n--------\n\n.. table::\n    :widths: 25\n\n    ======================   ====================================================\n    fan                      不加任何参数直接运行 ``fan`` , 则在默认浏览器中打开饭否主页\n    fan [文字] -i \u003cimage\u003e    上传图片。``-i`` 参数可以是图片的本地路径或者网络URL，网络URL请用引号引起来。文字可以为空。\n    fan -                    ``fan`` 命令后加短横线 ``-`` ，表示从标准输入(stdin)中读取内容。\n                             这样就可以输入多行的饭，输入完成后按 ``Ctrl+D`` (Windows下 ``Ctrl+Z`` )结束输入。\n                             也可以与其他命令结合起来使用，如 ``echo 'hello' | fan -``\n    fan -r                   撤回上一条饭\n    fan -v                   刷饭模式\n    fan -m                   查看自己的饭否资料\n    fan -d                   随机查看一些公开的饭\n    fan -u \u003cuser-id\u003e         查看他人的资料，``user-id`` 可从 ``fan -v`` 模式中获得\n    fan --login              登陆新的账号\n    fan --switch             切换账号\n    fan --config             自定义配置\n    fan --lock 1             上锁。非关注者无法查看你的状态。\n    fan --lock 0             解锁\n    fan --dump [文件名]      将所有饭否消息保存为JSON格式。文件名可选，默认为 ``fanfou-archive.json``\n    fan -h                   查看帮助\n    ======================   ====================================================\n\n初次使用时，此工具需要获取你的授权才能帮你发饭。\n此工具支持两种授权方式：\n- 一种是 OAuth，这种方式无需获取你的密码，是默认的授权方式。\n- 另一种是 XAuth，这种方式需要你输入用户名和密码（输入密码时自动关闭回显），适合在没有浏览器的场景使用，在使用 ``--xauth`` 参数时会使用此种方式。\n\n**你的密码仅在初次授权时需要，此工具不会保存。**\n\n如果你想取消对此工具的授权，可以随时访问 `\u003chttp://fanfou.com/settings/apps\u003e`_, 找到 **爱米饭**， 然后 **取消认证** 就可以了啦~\n\n说明\n====\n\n- 此工具会在 ``~/.fancache`` (\\*unix系统)或 ``%USERPROFILE%/.fancache`` 中保存认证凭据(access_token)，用户的饭否资料，和你的最新的一条饭否消息。你可以随时删除这个文件，不过删除之后需要重新授权。\n- OAuth认证时，此工具会启动一个 HTTP服务器，并监听本地的 8000 端口。Windows下会弹出权限提示，为了能够正常授权，请选择允许。\n- 上锁/解锁功能需要你在浏览器中的 cookie。在浏览器中打开饭否页面，然后按F12打开控制台，执行以下 Javascript 代码，将代码的输出结果粘贴到脚本中。\n\n.. code-block:: javascript\n\n    (/al=(.*?);/i).exec(document.cookie)[1]\n\n依赖\n====\n\n- Python3\n- requests-oauthlib\n- arrow\n\nTODO\n====\n\n- [x] 图片上传\n- [x] colorize\n- [x] time humanize\n- [x] 转发/评论消息\n- [x] 上锁/解锁功能\n- [x] 简化授权流程\n- [x] 查看图片\n- [x] xauth支持\n- [x] 修改配置功能\n- [x] 多账号切换\n- [ ] 备份进度条\n- [ ] 查看提到我的消息\n- [ ] 查看私信\n\n.. _pip: https://pip.pypa.io/en/stable/installing/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj178%2Ffanfou-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj178%2Ffanfou-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj178%2Ffanfou-cli/lists"}