亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 8578 | 回復(fù): 12
打印 上一主題 下一主題

Shell/Web 下發(fā)送 MSN Alert/Message  關(guān)閉 [復(fù)制鏈接]

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2005-07-11 14:01 |只看該作者 |倒序瀏覽
MSN 通常是用來交談的, Liunx 下最有名的 MSN Client 當(dāng)屬 gaim,
不過因為它是 GUI 的環(huán)境,要以 shell 來應(yīng)用實在不容易
(如果你能用 shell 控制 mouse 點在那裏就可以做到,但你能嗎 ? ()

1. 安裝 tmsnc (http://tmsnc.sourceforge.net/download.html)
我的例子是用 0.1.1 版本,你可以找別的版本自己開發(fā),或參考我的例子也可以

  1. $>wget http://unc.dl.sourceforge.net/sourceforge/tmsnc/tmsnc-0.1.1.tar.gz
  2. $>tar -zxvf tmsnc-0.1.1.tar.gz
  3. $>cd tmsnc-0.1.1
  4. # 看一下 Makefile , 裏面的 openssl 路徑是否符合你的環(huán)境
  5. $>make
  6. $>make install
  7. $>tmsnc   (啟動的樣子)
  8.       .........
  9.     .'------.' |
  10.    | .-----. | |
  11.    | |TMSNC| | |;.
  12.    |*`-----'.|.' `;
  13.    `---------' .;'
  14.   .''''////////;'
  15. / ######### /;/    The
  16. / ######### //   textbased
  17. `-----------'   alternative!

  18. Login: abel@twnic.net.tw
  19. Your login-address is abel@twnic.net.tw
  20. Enter password:
復(fù)制代碼

2.TMSNC 的指令說明

  1. # tmsnc 的 command 說明 (Readme),如果你要完善你的功能,就要詳讀任何的說明
  2. Availible commands in TMSNC are:
  3. * help                      show a list of availible commands
  4. * clear                     clear the screen
  5. * nick <name>               set your nickname to <name>
  6. * status <string>           where <string> is online, busy, brb,
  7. *                            away, phone, lunch or hidden
  8. * quit                      logout from server and quit TMSNC

  9. * add <address>             add <address> to the contact-list
  10. * block <address>           prevent <address> from obtaining your status
  11. * unblock <address>         reverse the block
  12. * remove <address>          remove <address> from contact-list
  13. * window <n> or TAB         change current window to <n>
  14. * window close or F7        close current window and conversation
  15. * chat <address> or Enter   start a new conversation with <address>
復(fù)制代碼

由以上我們可以知道, tmsnc 我們巳經(jīng)裝好了,所以就可以來做 shell 發(fā)送 msn 的工作了!
用 shell 來發(fā),最好的工具是 expect , 這個工具的說明,你可以在 man page 中找到詳細(xì)
解說

3.
3.1
範(fàn)例一(簡單版):

  1. #!/usr/bin/expect
  2. # filename=send.exp
  3. log_file ./exp.log
  4. spawn tmsnc -l 你申請的MSN帳號
  5. expect "Enter password:"
  6. send "你的密碼\r"
  7. expect -re ".* can't control me*"
  8. sleep 5

  9. send "/chat [lindex $argv 0]\n"
  10. expect -re ".*!.*"
  11. sleep 1
  12. send "Now: [exec date]\n"
  13. sleep 1
  14. send "[lindex $argv 1]\n"
  15. sleep 3
  16. send "/window close\r"
  17. send "/quit\r"
復(fù)制代碼


用法:

  1. #請注意, MSN訊息需為 UTF-8 encoding
  2. $>./send.exp MSN連絡(luò)人 MSN訊息
復(fù)制代碼


3.1
範(fàn)例二(稍複雜版):

[code]
#!/usr/bin/expect
# log file , for debug
log_file ./exp.log
#設(shè)定訊息路經(jīng)
set workdir "/www/htdocs/html/msn/msg"
# -l 指定 MSN contact, 你可以 tmsnc -h 來了解參數(shù)
spawn tmsnc -l 你申請的MSN帳號
sleep 1
# 出現(xiàn) password 時,送出密碼
expect "Enter password:"
send "你的密碼\r"
sleep 1
# 出現(xiàn) control me 時,表示 tmsnc 載入完成
expect -re ".* can't control me*"
sleep 3
# 無限迴圈,讀取訊息檔
while {1} {
        sleep 1
        #取得 訊息檔中第一行,我個人的定義是 MSN addr
        set msn_addr [ exec cat $workdir/msg.utf8 |  head -1 ]
        #如果

cu-reply.gif (17.89 KB, 下載次數(shù): 78)

mysql_alert.sh 發(fā)送的例子

mysql_alert.sh 發(fā)送的例子

論壇徽章:
0
2 [報告]
發(fā)表于 2005-07-11 19:01 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

參考!

論壇徽章:
0
3 [報告]
發(fā)表于 2005-07-12 00:00 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

非常不錯,值得學(xué)習(xí)。
redhat2005 該用戶已被刪除
4 [報告]
發(fā)表于 2005-07-12 15:45 |只看該作者
提示: 作者被禁止或刪除 內(nèi)容自動屏蔽

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
5 [報告]
發(fā)表于 2005-07-12 16:14 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

Makefile 中的
LIB= -L/usr/lib -lssl -lcrypto -lpanel -lncurses
INC= -I/usr/local/include -I/usr/local/ssl/include -I/usr/include/ssl

改成
  1. LIB= -L/usr/lib -L/usr/local/openssl/lib -lssl -lcrypto -lpanel -lncurses
  2. INC= -I/usr/local/include -I/usr/local/ssl/include -I/usr/include/ssl -I/usr/local/openssl/include
復(fù)制代碼


不然你就在裝一次 openssl 在 /usr 下,就不用改 makefile

論壇徽章:
0
6 [報告]
發(fā)表于 2005-07-22 09:58 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

要是能發(fā)短消息到手機(jī)就好了,呵呵
不過發(fā)到msn也是不錯的,謝謝你的分享!!

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
7 [報告]
發(fā)表于 2005-07-22 10:14 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

原帖由 "glider126" 發(fā)表:
要是能發(fā)短消息到手機(jī)就好了,呵呵
不過發(fā)到msn也是不錯的,謝謝你的分享!

發(fā)到手機(jī)簡單的很,你只要買點數(shù)就好了
廠商會給你 帳號/密碼及相關(guān) api

論壇徽章:
0
8 [報告]
發(fā)表于 2005-07-28 20:55 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

有心人啊,頂下先!

論壇徽章:
0
9 [報告]
發(fā)表于 2005-07-29 12:29 |只看該作者

Shell/Web 下發(fā)送 MSN Alert/Message

最好還是裝新版的openssl吧,編譯一定沒有問題.

每次看abel兄的文章總有大的收獲!非常感謝你.

論壇徽章:
0
10 [報告]
發(fā)表于 2005-11-23 17:48 |只看該作者
有沒有辦法獲得 contact list?
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP