{"id":18797269,"url":"https://github.com/hexsum/mojo-sinaweibo","last_synced_at":"2025-04-13T16:32:00.587Z","repository":{"id":33658620,"uuid":"37311103","full_name":"hexsum/Mojo-SinaWeibo","owner":"hexsum","description":"使用Perl语言编写的新浪微博客户端SDK，通过微博私信和微软小冰进行问答，提供小冰API接口，其他微博功能敬请期待","archived":false,"fork":false,"pushed_at":"2019-06-14T05:00:48.000Z","size":53,"stargazers_count":32,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-02T20:33:49.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexsum.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2015-06-12T08:29:38.000Z","updated_at":"2024-01-09T13:14:01.000Z","dependencies_parsed_at":"2022-09-13T08:51:05.911Z","dependency_job_id":null,"html_url":"https://github.com/hexsum/Mojo-SinaWeibo","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexsum%2FMojo-SinaWeibo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexsum%2FMojo-SinaWeibo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexsum%2FMojo-SinaWeibo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexsum%2FMojo-SinaWeibo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexsum","download_url":"https://codeload.github.com/hexsum/Mojo-SinaWeibo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223597062,"owners_count":17170872,"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":[],"created_at":"2024-11-07T22:07:44.350Z","updated_at":"2024-11-07T22:07:45.073Z","avatar_url":"https://github.com/hexsum.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"Mojo-SinaWeibo v1.6 [![Build Status](https://travis-ci.org/sjdy521/Mojo-SinaWeibo.svg?branch=master)](https://travis-ci.org/sjdy521/Mojo-SinaWeibo)\n========================\n使用Perl语言编写的新浪微博客户端SDK，基于Mojolicious，要求Perl版本不低于5.10\n实现新浪微博登录和私信功能，能够通过微博私信和微软小冰进行问答\n其他微博功能敬请期待\n\n###使用说明\n\n   1）准备一个可以和小冰正常私信往来的微博帐号\n   2）推荐微博帐号进行手机绑定，并设置常用登录地点免验证码登录（可以避免输入验证码带来的麻烦）\n   3）通过SDK提供的函数接口或者使用内置的API server来和小冰互动\n\n###SDK示例代码\n\n    use Mojo::SinaWeibo;\n    use Data::Dumper;\n    my $m = Mojo::SinaWeibo-\u003enew(\n         ua_debug=\u003e0,\n         log_level=\u003e\"info\",\n         user=\u003e'xxxxx',#微博帐号\n         pwd=\u003e'xxxx',  #帐号密码\n    );\n    $m-\u003eask_xiaoice(\"你是谁\",sub{print Dumper \\@_}); #中文使用UTF8编码\n    $m-\u003erun(enable_api_server=\u003e1,host=\u003e\"127.0.0.1\",port=\u003e8000);\n\n###API调用示例\n\n    \u003e GET /openxiaoice/ask?q=hello HTTP/1.1  #中文请使用UTF编码进行urlencode\n    \u003e User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5\n    \u003e Host: 127.0.0.1:8000\n    \u003e Accept: */*\n    \u003e \n    \u003c HTTP/1.1 200 OK\n    \u003c Server: Mojolicious (Perl)\n    \u003c Content-Type: application/json;charset=UTF-8\n    \u003c Connection: keep-alive\n    \u003c Date: Fri, 12 Jun 2015 08:01:08 GMT\n    \u003c Content-Length: 52\n    Connection #0 to host 127.0.0.1 left intact\n    * Closing connection #0\n    {\"code\":1,\"answer\":\"hello.这么巧你也失眠了\"}\n\n###运行日志\n\n    [15/06/12 16:00:47] [info] 准备登录微博帐号[ xxxx ]\n    [15/06/12 16:00:47] [info] 正在登录...\n    [15/06/12 16:00:49] [info] 登录成功\n    [15/06/12 16:00:49] [info] http server available at 0.0.0.0:8000\n    [15/06/12 16:00:49] [私信消息] 我-\u003e小冰 : 你是谁\n    [15/06/12 16:00:51] [私信消息] 我-\u003e小冰 : howareyou\n    [15/06/12 16:00:51] [私信消息] 小冰 : 我是小灰啊，陪在你身边的知心人\n    [15/06/12 16:00:52] [私信消息] 小冰 : 我爸爸给我买了个表\n    [15/06/12 16:01:00] [私信消息] 我-\u003e小冰 : hello\n    [15/06/12 16:01:08] [私信消息] 小冰 : hello.这么巧你也失眠了\n\n###安装步骤\n\n推荐使用[cpanm](https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm)在线安装[Mojo::SinaWeibo](https://metacpan.org/pod/Mojo::SinaWeibo)模块\n\n1. *安装cpanm工具*\n\n    方法a： 通过cpan安装cpanm\n\n        $ cpan -i App::cpanminus\n\n    方法b： 直接在线安装cpanm\n\n        $ curl -L http://cpanmin.us | perl - App::cpanminus\n\n2. *使用cpanm在线安装 Mojo::SinaWeibo 模块*\n\n        $ cpanm -v Mojo::SinaWeibo\n\n3. *安装失败可能有帮助的解决方法*\n\n    如果你运气不佳，通过cpanm没有一次性安装成功，这里提供了一些可能有用的信息\n\n    在安装 Mojo::SinaWeibo 的过程中，cpan或者cpanm会帮助我们自动安装很多其他的依赖模块\n\n    在众多的依赖模块中，安装经常容易出现问题的主要是 IO::Socket::SSL\n\n    IO::Socket::SSL 主要提供了 https 支持，在安装过程中可能会涉及到SSL相关库的编译\n\n    对于 Linux 用户，通常采用的是编译安装的方式，系统缺少编译安装必要的环境，则会导致编译失败\n\n    对于 Windows 用户，由于不具备良好的编译安装环境，推荐采用一些已经打包比较全面的Perl运行环境\n\n    例如比较流行的 strawberryperl 或者 activeperl 的最新版本都默认包含 Mojo::SinaWeibo 的核心依赖模块\n\n    RedHat/Centos:\n\n        $ yum install -y openssl-devel\n\n    Ubuntu:\n\n        $ sudo apt-get install libssl-dev\n\n    Window:\n\n    这里以 strawberryperl 为例\n\n    安装 [Strawberry Perl](http://strawberryperl.com/)，这是一个已经包含 Mojo::SinaWeibo 所需核心依赖的较全面的Windows Perl运行环境\n\n    [32位系统安装包](http://strawberryperl.com/download/5.22.0.1/strawberry-perl-5.22.0.1-32bit.msi)\n\n    [64位系统安装包](http://strawberryperl.com/download/5.22.0.1/strawberry-perl-5.22.0.1-64bit.msi)\n\n    或者自己到 [Strawberry Perl官网](http://strawberryperl.com/) 下载适合自己的最新版本\n\n    安装前最好先卸载系统中已经安装的其他Perl版本以免互相影响\n\n    搞定了编译和运行环境之后，再重新回到 步骤2 安装 Mojo::SinaWeibo 即可\n\n###核心依赖模块\n\n* Mojolicious\n* Crypt::RSA\n* Encode::Locale\n\n###相关文档\n\n* [更新日志](https://github.com/sjdy521/Mojo-SinaWeibo/blob/master/Changes)\n* [开发文档](https://metacpan.org/pod/Mojo::SinaWeibo)\n\n###官方交流\n\n* [QQ群](http://jq.qq.com/?_wv=1027\u0026k=kjVJzo)\n* [IRC](http://irc.perfi.wang/?channel=#Mojo-Webqq)\n\n###版本更新记录\n\n请参见 Changes 文件\n\n###COPYRIGHT 和 LICENCE\n\nCopyright (C) 2014 by sjdy521\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself, either Perl version 5.10.0 or,\nat your option, any later version of Perl 5 you may have available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexsum%2Fmojo-sinaweibo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexsum%2Fmojo-sinaweibo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexsum%2Fmojo-sinaweibo/lists"}