develpr / morseling
Morseling (morse code API) helper.
dev-master
2013-12-21 06:07 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-11-09 14:58:08 UTC
README
Purpose
This package is made to allow simple communication with the Morsel API.
With it, you can:
- create a new message
- get a transmission
- update a transmission to be read
Additionally, you should be able to easily fork/modify the code to add additional features, as allowed by the Morsel API.
Use
Usage is simple:
//Create an instance of the Morseling API helper
$morseling = new Develpr\Morseling\Morseling;
(You can find your Morsel id and shared secret at your Morsel account)
//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!";
Passing in an optional boolean true
will automatically mark the transmission as received.
//Now we're all set! Let's get the latest transmission and mark it as received
$morsel->getTransmission(true);