develpr/morseling

Morseling(摩尔斯电码API)助手。

dev-master 2013-12-21 06:07 UTC

This package is not auto-updated.

Last update: 2024-09-28 14:32:52 UTC


README

目的

本包旨在允许与Morsel API进行简单通信。

使用它,您可以

  1. 创建一条新消息
  2. 获取传输
  3. 更新传输以供阅读

此外,您应该能够轻松地分叉/修改代码以添加更多功能,如Morsel API所允许的。Morsel API

使用方法

使用方法简单

//Create an instance of the Morseling API helper
$morseling = new Develpr\Morseling\Morseling;

(您可以在您的Morsel账户中找到您的Morsel ID和共享密钥)

//Set your Morsel ID
$morseling->setId(1);

//Set you shared secret
$morsel->setSecret('bluemyself');

//Now we're all set! Let's get the latest transmission
$transmission = $morsel->getTransmission(false);

if($transmission)
	echo "The latest transmission said " . $transmission->message->text;
else
	echo "no new transmissions!";

传递可选的布尔值 true 将自动标记传输为已接收。

//Now we're all set! Let's get the latest transmission and mark it as received
$morsel->getTransmission(true);