Tommy 碎碎念

Tommy Wu's blog

« 上一篇 | 下一篇 »

msn.class.php v1.5, fix some small bug
post by tommy @ 06 四月, 2007 18:54

修改之前發送 MSN 的 php calss. 修正一些 bug.

檔案放於: http://www.teatime.com.tw/~tommy/files/msnclass15.7z
或者抓最新的版本: http://www.teatime.com.tw/~tommy/files/msnclass.7z

異動說明:

  • 更改傳輸時的逾時設定,  由 10 秒改成 2 秒. 可以加速處理的速度. 如果你有因為這個更改而無法順利使用時,  可以更改 msn.class.php 中的 $stream_timeout 變數值.
  • Alias 有空白時會有問題. 在送出 PRP 指令前, 必須對 alias 編碼.
  • 修正 sendMessage() 無法傳送到 yahoo 的問題.

2007/04/06:

在 Google Code 開一個 project: phpmsnclass, 以後程式碼會丟到上頭去, 檔案請直拉去那邊下載就可以了. 

Del.icio.us Furl HEMiDEMi Technorati MyShare
commons icon [1] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

// auto detect MSN protocol, without debug information
$msn = new MSN;

使用非 debug 模式無法傳送訊息?

commons icon [2] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

我剛剛試了一下, 沒設定 debug 模式的話, 一樣可以正常的傳送訊息. 所以... 我也不知道您的問題會是在那兒.

commons icon [3] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

有辦法送離線訊息嗎?

commons icon [4] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

如果你的 php 的 module 可以支援 MSNP15 用到的東西 (mcrypt, mhash, bcmath), 就可以發送離線訊息.

commons icon [5] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

想請教這東西跟http://www.blobsy.org/Main/HomePage

是不是類似的?

commons icon [6] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

某方面來說, 算是一樣的東西吧.
當初有抓這個回來用, 不過... 程式看了覺得太難改, 且不支援離線訊息, 所以就沒有使用, 而是自己寫一個來用.

commons icon [7] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

Hi tommy你好:
首先謝謝你的分享,這個code真是太好用了.
我依照你的說明已經安裝成功也正常運作.
但現在有個小問題想請教一下,就是當我將msn bot新增到聯絡人後,可以收到bot傳送過來的訊息
但是bot的線上狀態始終維持在離線.
因此我想問的是,該如何才能讓它bot的線上狀態維持在線上呢?

再次感謝你的閱讀.

commons icon [8] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

照說 MSNP9 並不用做什麼事, 就應該可以看到上線的狀態.
如果用 MSNP15, 則必需加入名單, 且登入時用 ADL 指令送出後才會看到狀態.

如果可能, 使用 debug 的模式, 把產生的記錄送來給我看看吧.

wu.tommy @ gmail.com

commons icon [9] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

謝謝你,我剛才仔細看了一下debug下的訊息.
發現msnbot是用msnp9的protocol在跑.
而我用的是WLM8.1.
等我在仔細測試後在來向你請教.
謝謝你的回覆 :)

commons icon [10] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

hi tommy兄:
謝謝你的提醒,現在已經可以正常顯示上線狀態了.

commons icon [11] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

你好,有些問題想請教,可否問下你的聯系方式?比如郵箱,謝謝!

commons icon [12] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

這一篇的前幾個留言不是就有留 google 的 email 了嗎?

commons icon [13] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

我希望能做到機器人收到訊息塞入資料庫,請問該從您程式那邊著手??可否指導一下!!謝謝!!

commons icon [14] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

另外想請教我將該msn bot抓入其他人的對談中他會自動跳出,不知是何種原因??

commons icon [15] Re:msn.class.php v1.5, fix some small bug [ 回覆 ]

接受訊息的處理請修改 msnbot.php 中的 processMsg() 就可以.
至於對談後跳出, 是程式設計上的結果. 除非改用 multi-thread 或 multi-process 的方式去處理 switchboard 的使用, 否則, 目前會在傳訊後或接收訊息後就離開該 switchboard.

迴響
暱稱:
標題:
個人網頁:
電子郵件:
authimage

迴響

  

Bad Behavior 已經阻擋了 61 個過去 7 天試圖闖關的垃圾迴響與引用。
Power by LifeType. Template design by JamesHuang. Valid XHTML and CSS