<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Mojo-Webqq v1.7.1 [![Build Status](https://travis-ci.org/sjdy521/Mojo-Webqq.svg?branch=master)](https://travis-ci.org/sjdy521/Mojo-Webqq)
========================
ä½¿ç”¨Perlè¯­è¨€ç¼–å†™çš„Smartqqå®¢æˆ·ç«¯æ¡†æž¶ï¼ŒåŸºäºŽMojoliciousï¼Œè¦æ±‚Perlç‰ˆæœ¬5.10.1+ï¼Œå¯é€šè¿‡æ’ä»¶æä¾›åŸºäºŽHTTPåè®®çš„apiæŽ¥å£ä¾›å…¶ä»–è¯­è¨€æˆ–ç³»ç»Ÿè°ƒç”¨

###æ’ä»¶åˆ—è¡¨
``` 
  åç§°                 ä¼˜å…ˆçº§   å½“å‰çŠ¶æ€    githubä½œè€…    åŠŸèƒ½è¯´æ˜Ž
  ------------------------------------------------------------------------------
  ShowMsg              100      å·²å‘å¸ƒ      sjdy521       æ‰“å°å®¢æˆ·ç«¯æŽ¥æ”¶å’Œå‘é€çš„æ¶ˆæ¯
  GroupManage          100      å·²å‘å¸ƒ      sjdy521       ç¾¤ç®¡ç†ï¼Œå…¥ç¾¤æ¬¢è¿Žã€é™åˆ¶å‘å›¾é¢‘çŽ‡ç­‰
  MsgSync              99       å·²å‘å¸ƒ      sjdy521       å®žçŽ°qqç¾¤å’Œircæ¶ˆæ¯åŒæ­¥
  IRCShell             99       å·²å‘å¸ƒ      sjdy521       LinuxçŽ¯å¢ƒä¸‹é€šè¿‡ircå®¢æˆ·ç«¯ä½¿ç”¨qq
  Openqq               98       å·²å‘å¸ƒ      sjdy521       æä¾›qqå‘é€æ¶ˆæ¯apiæŽ¥å£
  Perlcode             97       å·²å‘å¸ƒ      sjdy521       é€šè¿‡qqæ¶ˆæ¯æ‰§è¡Œperlä»£ç&nbsp;
  Perldoc              96       å·²å‘å¸ƒ      sjdy521       é€šè¿‡qqæ¶ˆæ¯æŸ¥è¯¢perlæ–‡æ¡£
  StockInfo            95       å·²å‘å¸ƒ      shalk         æŸ¥è¯¢è‚¡ç¥¨ä¿¡æ¯
  ProgramCode          94       å·²å‘å¸ƒ      limengyu1990  é€šè¿‡qqæ¶ˆæ¯æ‰§è¡Œä»£ç&nbsp;ï¼Œæ”¯æŒ26ç§è¯­è¨€
  Translation          93       å·²å‘å¸ƒ      sjdy521       å¤šå›½è¯­è¨€ç¿»è¯‘åŠŸèƒ½
  MobileInfo           93       å·²å‘å¸ƒ      limengyu1990  æ‰‹æœºå·ç&nbsp;å½’å±žåœ°æŸ¥è¯¢
  KnowledgeBase        2        å·²å‘å¸ƒ      sjdy521       é€šè¿‡qqæ¶ˆæ¯è‡ªå®šä¹‰é—®ç­”çŸ¥è¯†åº“
  FuckDaShen           1        å·²å‘å¸ƒ      sjdy521       å¯¹æ¶ˆæ¯ä¸­çš„"å¤§ç¥ž"å…³é”®è¯è¿›è¡Œé„™è§†
  PostImgVerifycode    0        å·²å‘å¸ƒ      sjdy521       ç™»å½•éªŒè¯ç&nbsp;å‘é€åˆ°é‚®ç®±å®žçŽ°è¿œç¨‹ç™»å½•
  PostQRcode           0        å·²å‘å¸ƒ      sjdy521       ç™»å½•äºŒç»´ç&nbsp;å‘é€åˆ°é‚®ç®±å®žçŽ°è¿œç¨‹æ‰«ç&nbsp;
  SmartReply           0        å·²å‘å¸ƒ      sjdy521       æ™ºèƒ½èŠå¤©å›žå¤
```
###æ•ˆæžœå±•ç¤º
```
[15/09/30 15:11:59] [info] åˆå§‹åŒ– smartqq å®¢æˆ·ç«¯å‚æ•°...
[15/09/30 15:11:59] [info] æ£€æŸ¥éªŒè¯ç&nbsp;...
[15/09/30 15:11:59] [info] æ£€æŸ¥ç»“æžœ: å¾ˆå¹¸è¿ï¼Œæœ¬æ¬¡ç™»å½•ä¸éœ€è¦éªŒè¯ç&nbsp;
[15/09/30 15:11:59] [info] æ­£åœ¨èŽ·å–ç™»å½•äºŒç»´ç&nbsp;...
[15/09/30 15:11:59] [info] äºŒç»´ç&nbsp;å·²ä¸‹è½½åˆ°æœ¬åœ°[ /tmp/mojo_webqq_qrcode_xxx.png ]
[15/09/30 15:12:00] [info] ç™»å½•äºŒç»´ç&nbsp;å·²ç»å‘é€åˆ°é‚®ç®±: ******
[15/09/30 15:12:00] [info] ç­‰å¾…æ‰‹æœºQQæ‰«æäºŒç»´ç&nbsp;...
[15/09/30 15:12:43] [info] æ‰‹æœºQQæ‰«ç&nbsp;æˆåŠŸï¼Œè¯·åœ¨æ‰‹æœºä¸Šç‚¹å‡»[å…è®¸ç™»å½•smartQQ]æŒ‰é’®...
[15/09/30 15:12:46] [info] æ£€æŸ¥å®‰å…¨ä»£ç&nbsp;...
[15/09/30 15:12:47] [info] è®¾ç½®ç™»å½•éªŒè¯å‚æ•°...
[15/09/30 15:12:47] [info] å°è¯•è¿›è¡Œç™»å½•(2)...
[15/09/30 15:12:47] [info] ç™»å½•æˆåŠŸ
[15/09/30 15:12:47] [info] æ›´æ–°ä¸ªäººä¿¡æ¯...
[15/09/30 15:12:47] [info] æ›´æ–°å¥½å‹ä¿¡æ¯...
[15/09/30 15:12:47] [info] æ›´æ–°[ PERLå­¦ä¹&nbsp;äº¤æµ ]ä¿¡æ¯
[15/09/30 15:12:52] [info] æ›´æ–°[ Mojolicious ]ä¿¡æ¯
[15/09/30 15:12:55] [info] å¼€å§‹æŽ¥æ”¶æ¶ˆæ¯...
[15/09/30 14:09:20] [ç¾¤æ¶ˆæ¯] å°ç°|PERLå­¦ä¹&nbsp;äº¤æµ : Mojo::Webqqä¸é”™å“¦
[15/09/30 14:10:20] [ç¾¤æ¶ˆæ¯] æˆ‘-&gt;PERLå­¦ä¹&nbsp;äº¤æµ : å¤šè°¢å¤šè°¢
```
###é€šè¿‡ircå®¢æˆ·ç«¯åœ¨linuxç»ˆç«¯ä¸Šä½¿ç”¨QQ

![IRCShell](screenshot/IRCShell.png)

###å®‰è£…æ–¹æ³•

æŽ¨èä½¿ç”¨[cpanm](https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm)åœ¨çº¿å®‰è£…[Mojo::Webqq](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod)æ¨¡å— 

1. *å®‰è£…cpanmå·¥å…·*

    æ–¹æ³•aï¼š é€šè¿‡cpanå®‰è£…cpanm

        $ cpan -i App::cpanminus
    
    æ–¹æ³•bï¼š ç›´æŽ¥åœ¨çº¿å®‰è£…cpanm

        $ curl -L http://cpanmin.us | perl - App::cpanminus

2. *ä½¿ç”¨cpanmåœ¨çº¿å®‰è£… Mojo::Webqq æ¨¡å—*

        $ cpanm -v Mojo::Webqq

3. *å®‰è£…å¤±è´¥å¯èƒ½æœ‰å¸®åŠ©çš„è§£å†³æ–¹æ³•*
        
    å¦‚æžœä½&nbsp;è¿æ°”ä¸ä½³ï¼Œé€šè¿‡cpanmæ²¡æœ‰ä¸€æ¬¡æ€§å®‰è£…æˆåŠŸï¼Œè¿™é‡Œæä¾›äº†ä¸€äº›å¯èƒ½æœ‰ç”¨çš„ä¿¡æ¯

    åœ¨å®‰è£… Mojo::Webqq çš„è¿‡ç¨‹ä¸­ï¼Œcpanæˆ–è€…cpanmä¼šå¸®åŠ©æˆ‘ä»¬è‡ªåŠ¨å®‰è£…å¾ˆå¤šå…¶ä»–çš„ä¾èµ–æ¨¡å—
    
    åœ¨ä¼—å¤šçš„ä¾èµ–æ¨¡å—ä¸­ï¼Œå®‰è£…ç»å¸¸å®¹æ˜“å‡ºçŽ°é—®é¢˜çš„ä¸»è¦æ˜¯ IO::Socket::SSL
    
    IO::Socket::SSL ä¸»è¦æä¾›äº† https æ”¯æŒï¼Œåœ¨å®‰è£…è¿‡ç¨‹ä¸­å¯èƒ½ä¼šæ¶‰åŠåˆ°SSLç›¸å…³åº“çš„ç¼–è¯‘

    å¯¹äºŽ Linux ç”¨æˆ·ï¼Œé€šå¸¸é‡‡ç”¨çš„æ˜¯ç¼–è¯‘å®‰è£…çš„æ–¹å¼ï¼Œç³»ç»Ÿç¼ºå°‘ç¼–è¯‘å®‰è£…å¿…è¦çš„çŽ¯å¢ƒï¼Œåˆ™ä¼šå¯¼è‡´ç¼–è¯‘å¤±è´¥
    
    å¯¹äºŽ Windows ç”¨æˆ·ï¼Œç”±äºŽä¸å…·å¤‡è‰¯å¥½çš„ç¼–è¯‘å®‰è£…çŽ¯å¢ƒï¼ŒæŽ¨èé‡‡ç”¨ä¸€äº›å·²ç»æ‰“åŒ…æ¯”è¾ƒå…¨é¢çš„Perlè¿è¡ŒçŽ¯å¢ƒ
    
    ä¾‹å¦‚æ¯”è¾ƒæµè¡Œçš„ strawberryperl æˆ–è€… activeperl çš„æœ€æ–°ç‰ˆæœ¬éƒ½é»˜è®¤åŒ…å« Mojo::Webqq çš„æ&nbsp;¸å¿ƒä¾èµ–æ¨¡å—

    RedHat/Centos:

        $ yum install -y openssl-devel
        
    Ubuntu:

        $ sudo apt-get install libssl-dev

    Window:
        
    è¿™é‡Œä»¥ strawberryperl ä¸ºä¾‹

    å®‰è£… [Strawberry Perl](http://strawberryperl.com/)ï¼Œè¿™æ˜¯ä¸€ä¸ªå·²ç»åŒ…å« [Mojo::Webqq](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod) æ‰€éœ€æ&nbsp;¸å¿ƒä¾èµ–çš„è¾ƒå…¨é¢çš„Windows Perlè¿è¡ŒçŽ¯å¢ƒ 
    
    [32ä½ç³»ç»Ÿå®‰è£…åŒ…](http://strawberryperl.com/download/5.22.0.1/strawberry-perl-5.22.0.1-32bit.msi)
        
    [64ä½ç³»ç»Ÿå®‰è£…åŒ…](http://strawberryperl.com/download/5.22.0.1/strawberry-perl-5.22.0.1-64bit.msi)
        
    æˆ–è€…è‡ªå·±åˆ° [Strawberry Perlå®˜ç½‘](http://strawberryperl.com/) ä¸‹è½½é€‚åˆè‡ªå·±çš„æœ€æ–°ç‰ˆæœ¬
    
    å®‰è£…å‰æœ€å¥½å…ˆå¸è½½ç³»ç»Ÿä¸­å·²ç»å®‰è£…çš„å…¶ä»–Perlç‰ˆæœ¬ä»¥å…äº’ç›¸å½±å“
    
    æžå®šäº†ç¼–è¯‘å’Œè¿è¡ŒçŽ¯å¢ƒä¹‹åŽï¼Œå†é‡æ–°å›žåˆ° æ­¥éª¤2 å®‰è£…Mojo::Webqqå³å¯
        

###å¦‚ä½•ä½¿ç”¨

1. *æˆ‘å¯¹Perlå¾ˆç†Ÿæ‚‰ï¼Œæ˜¯ä¸€ä¸ªä¸“ä¸šçš„Perler*

    è¯¥é¡¹ç›®æ˜¯ä¸€ä¸ªçº¯ç²¹çš„Perlæ¨¡å—ï¼Œå·²ç»å‘å¸ƒåˆ°äº†cpanä¸Šï¼Œè¯·ä»”ç»†é˜…è¯» `Mojo::Weqq` æ¨¡å—çš„[ä½¿ç”¨æ–‡æ¡£](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod)

    é™¤æ­¤ä¹‹å¤–ï¼Œä½&nbsp;å¯ä»¥çœ‹ä¸‹ [demo](https://github.com/sjdy521/Mojo-Webqq/tree/master/demo) ç›®å½•ä¸‹çš„æ›´å¤šä»£ç&nbsp;ç¤ºä¾‹

2. *æˆ‘æ˜¯å¯¹Perlä¸ç†Ÿæ‚‰ï¼Œæ˜¯ä¸€ä¸ªå…¶ä»–è¯­è¨€çš„å¼€å‘è€…ï¼Œåªå¯¹æä¾›çš„æ¶ˆæ¯å‘é€/æŽ¥æ”¶æŽ¥å£æ„Ÿå…´è¶£*

    å¯ä»¥ç›´æŽ¥æŠŠå¦‚ä¸‹ä»£ç&nbsp;ä¿å­˜æˆä¸€ä¸ªæºç&nbsp;æ–‡ä»¶ï¼Œä½¿ç”¨ perl è§£é‡Šå™¨æ¥è¿è¡Œ
    
        #!/usr/bin/env perl
        use Mojo::Webqq;
        my ($qq,$host,$port,$post_api);
        
        $qq = 12345678;    #ä¿®æ”¹ä¸ºä½&nbsp;è‡ªå·±çš„å®žé™…QQå·ç&nbsp;
        $host = "0.0.0.0"; #å‘é€æ¶ˆæ¯æŽ¥å£ç›‘å¬åœ°å€ï¼Œä¿®æ”¹ä¸ºè‡ªå·±å¸Œæœ›ç›‘å¬çš„åœ°å€
        $port = 5000;      #å‘é€æ¶ˆæ¯æŽ¥å£ç›‘å¬ç«¯å£ï¼Œä¿®æ”¹ä¸ºè‡ªå·±å¸Œæœ›ç›‘å¬çš„ç«¯å£
        $post_api = 'http://xxxx';  #æŽ¥æ”¶åˆ°çš„æ¶ˆæ¯ä¸ŠæŠ¥æŽ¥å£ï¼Œå¦‚æžœä¸éœ€è¦æŽ¥æ”¶æ¶ˆæ¯ä¸ŠæŠ¥ï¼Œå¯ä»¥åˆ&nbsp;é™¤æ­¤è¡Œ
        
        my $client = Mojo::Webqq-&gt;new(qq=&gt;$qq);
        $client-&gt;login();
        $client-&gt;load("ShowMsg");
        $client-&gt;load("Openqq",data=&gt;{listen=&gt;[{host=&gt;$host,port=&gt;$port}], post_api=&gt;$post_api});
        $client-&gt;run();
    
    ä¸Šè¿°ä»£ç&nbsp;ä¿å­˜æˆ xxxx.pl æ–‡ä»¶ï¼Œç„¶åŽä½¿ç”¨ perl æ¥è¿è¡Œï¼Œå°±ä¼šå®Œæˆ QQ ç™»å½•å¹¶åœ¨æœ¬æœºäº§ç”Ÿä¸€ä¸ªç›‘å¬æŒ‡å®šåœ°å€ç«¯å£çš„ http server
    
        $ perl xxxx.pl
    
    å‘é€å¥½å‹æ¶ˆæ¯çš„æŽ¥å£è°ƒç”¨ç¤ºä¾‹
    
        http://127.0.0.1:5000/openqq/send_message?qq=&gt;xxxxx&amp;content=hello
        
        * About to connect() to 127.0.0.1 port 5000 (#0)
        *   Trying 127.0.0.1...
        * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)
        &gt; GET /openqq/send_message?qq=&gt;xxxxx&amp;content=hello HTTP/1.1
        &gt; User-Agent: curl/7.29.0
        &gt; Host: 127.0.0.1:5000
        &gt; Accept: */*
        &gt; 
        &lt; HTTP/1.1 200 OK
        &lt; Content-Type: application/json;charset=UTF-8
        &lt; Date: Sun, 13 Dec 2015 04:54:38 GMT
        &lt; Content-Length: 52
        &lt; Server: Mojolicious (Perl)
        &lt;
        * Connection #0 to host 127.0.0.1 left intact
        
        {"status":"å‘é€æˆåŠŸ","msg_id":23910327,"code":0}
    
    æ›´å¤šæŽ¥å£å‚æ•°è¯´æ˜Žå‚åŠ&nbsp;[Openqqæ’ä»¶ä½¿ç”¨æ–‡æ¡£](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod#Mojo::Webqq::Plugin::Openqq)
    
3.  *æˆ‘æ˜¯ä¸€ä¸ªæžå®¢ï¼Œæˆ‘åªæƒ³èƒ½å¤Ÿåœ¨å‘½ä»¤è¡Œä¸Šé€šè¿‡  IRC çš„æ–¹å¼æ¥çŽ©è½¬ QQ èŠå¤©*
            
        $ cpanm -v Mojo::IRC::Server::Chinese #å…ˆå®‰è£… IRC ä¾èµ–æ¨¡å—

        $ perl -MMojo::Webqq -e 'Mojo::Webqq-&gt;new(qq=&gt;$ARGV[0])-&gt;login-&gt;load(["ShowMsg","IRCShell"])-&gt;run()' xxxx #æˆ‘çš„QQå·ç&nbsp;ä½œä¸ºå‘½ä»¤ç¬¬ä¸€ä¸ªå‚æ•°
    
    ä½¿ç”¨weechatã€irssiã€mIRC ç­‰ä»»æ„æ”¯æŒIRCçš„å®¢æˆ·ç«¯æ¥è¿žæŽ¥æœ¬æœºçš„6667ç«¯å£ï¼Œå³å¯åƒæ™®é€šçš„IRCä¸€æ&nbsp;·çš„æ–¹å¼æ¥ä½¿ç”¨QQ

4. *æˆ‘æ˜¯ä¸€ä¸ª QQ ç¾¤ä¸»æˆ–ç®¡ç†å‘˜ï¼Œæˆ‘æƒ³ç»™è‡ªå·±çš„ç¾¤åŠ&nbsp;ä¸ªæœºå™¨äººç¾¤ç®¡ç†åŠŸèƒ½*

    è¯·å…³æ³¨ [GroupManage æ’ä»¶ä½¿ç”¨æ–‡æ¡£](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod#Mojo::Webqq::Plugin::GroupManage)   


###æ&nbsp;¸å¿ƒä¾èµ–æ¨¡å—

* [Mojolicious](https://metacpan.org/pod/Mojolicious)
* [Encode::Locale](https://metacpan.org/pod/Encode::Locale)

###ç›¸å…³æ–‡æ¡£

* [æ›´æ–°æ—¥å¿—](https://github.com/sjdy521/Mojo-Webqq/blob/master/Changes)
* [å¼€å‘æ–‡æ¡£](https://metacpan.org/pod/distribution/Mojo-Webqq/doc/Webqq.pod)

###å®˜æ–¹äº¤æµ

* [QQç¾¤](http://jq.qq.com/?_wv=1027&amp;k=kjVJzo)
* [IRC](http://irc.perfi.wang/?channel=#Mojo-Webqq)

###COPYRIGHT å’Œ LICENCE

Copyright (C) 2014 by sjdy521

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.

</pre></body></html>