XMPP/Jabber的Ruby类库 XMPP4R

码农软件 · 软件分类 · 网络工具包 · 2019-03-03 06:14:44

软件介绍

XMPP4R是一个XMPP/Jabber的Ruby类库。它的目标是提供开发Jabber相关应用程序或者Ruby脚本的完整框架。

安装方法:gem install xmpp4r

示例代码:

  # Send a message to a friend, asking for authorization if necessary:
im = Jabber::Simple.new("user@example.com", "password")
im.deliver("friend@example.com", "Hey there friend!")

# Get received messages and print them out to the console:
im.received_messages { |msg| puts msg.body if msg.type == :chat }

# Send an authorization request to a user:
im.add("friend@example.com")

# Get presence updates from your friends, and print them out to the console:
# (admittedly, this one needs some work)
im.presence_updates { |update|
from = update[0].jid.strip.to_s
status = update[2].status
presence = update[2].show
puts "#{from} went #{presence}: #{status}"
end

# Remove a user from your contact list:
im.remove("unfriendly@example.com")

# See the Jabber::Simple documentation for more information.

本文地址:https://codercto.com/soft/d/505.html

长尾理论2.0

长尾理论2.0

安德森 / 乔江涛、石晓燕 / 中信出版社 / 2009-5 / 42.00元

《长尾理论2.0》是克里斯·安德森对所有问题最明确的回答。在此书中,他详细阐释了长尾的精华所在,揭示了长尾现象是如何从工业资本主义原动力——规模经济与范围经济——的矛盾中产生出来的。长尾现象虽然是明显的互联网现象,但其商务逻辑本身,却是从工业经济中自然而然“长”出来的,网络只是把酝酿了几十年的供应链革命的诸多要素简单地结合在一起了。同时,长尾理论转化为行动,最有力、最可操作的就是营销长尾,通过口碑......一起来看看 《长尾理论2.0》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具