发送任意内容的短信
在一个桌面会话,加载创建短信演示通道(WIM)的程序包并开始侦听.
In[1]:=

Needs["DemoChannels`WIM`"]
创建你的 WIM 通道并开始侦听.
In[2]:=

channel = CreateWIMChannel[]
Out[2]=

In[3]:=

listener = ChannelListen[channel]
Out[3]=

给自己发送 WIM,注意到它会在新的对话笔记本中显示你的消息.
In[4]:=

ChannelSend["WIM", "Hi there."]
Out[4]=

Out[5]=

将目前笔记版添附在消息中.
In[6]:=

ChannelSend["WIM", {"Sending a notebook.", InputNotebook[]}]
Out[6]=

Out[7]=

其他用户可通过引用你的完全合格的通道向你发送 WIM.
In[8]:=

yourWIM = $WolframID <> ":WIM"
Out[8]=

In[9]:=

ChannelSend[yourWIM, "hello"]
Out[9]=

或者你的 WIM 链接.
In[10]:=

listener["URL"]
Out[10]=

In[11]:=

listener["URL"];
ChannelSend[%, "another message"]
Out[11]=

任何人都可以通过创建对以下链接的 HTTP 请求从网页浏览器(或任何其他 HTTP 客户端)向你发送消息.
In[12]:=

URLBuild[listener["URL"], {"operation" -> "send",
"Message" -> "yet another message"}]
Out[12]=

In[13]:=

URLBuild[listener["URL"], {"operation" -> "send",
"Message" -> "yet another message"}];
URLFetch[%]
Out[13]=

为回复来自其他用户的信息,在用户信道对通信进行授权.
In[14]:=

Unprotect[$AllowExternalChannelFunctions];
$AllowExternalChannelFunctions = True;
停止侦听并重置保密设定.
In[15]:=

RemoveChannelListener[listener]
Out[15]=

In[16]:=

$AllowExternalChannelFunctions = False;
Protect[$AllowExternalChannelFunctions];