Maniaflash as frame like tsviewer
Posted: 16 Feb 2014, 22:03
Are there any possibilities to include the maniaflash news into your own manialink?
Code: Select all
<?php
/**
* Maniaplanet Web Services SDK for PHP
*
* @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
* @author $Author: maximeraoust $:
* @version $Revision: 2 $:
* @date $Date: 2011-09-08 18:03:11 +0200 (Thu, 08 Sep 2011) $:
*/
require_once __DIR__.'/libraries/autoload.php';
try
{
$mf = new Maniaplanet\WebServices\ManiaFlash('loginMPWS','passwordMPWS');
$id = 'thedoge'; // ManiaFlash Channel ID:
$list = $mf->getChannel($id);
/**
* Return informations about a ManiaFlash
* @param string $id
* @return Object
* - name
* - description
* - id
* @throws Exception
*/
var_dump($list->id);
}
catch(\Maniaplanet\WebServices\Exception $e)
{
echo "Error!\n";
printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
$e->getHTTPStatusMessage());
echo "\n";
printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
echo "\n";
}
echo "\n";
?>
Code: Select all
<?php
/**
* Maniaplanet Web Services SDK for PHP
*
* @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
* @author $Author: maximeraoust $:
* @version $Revision: 2 $:
* @date $Date: 2011-09-08 18:03:11 +0200 (Thu, 08 Sep 2011) $:
*/
require_once __DIR__.'/libraries/autoload.php';
try
{
$mf = new Maniaplanet\WebServices\ManiaFlash('loginMPWS','passwordMPWS');
$id = 'thedoge'; // ManiaFlash Channel ID:
$list = $mf->getMessages($id, $offset = 0, $length = 10);
/**
* Return latest messages of a channel
* @param string $id
* @return Object[]
* - id
* - author
* - dateCreated
* - message
* - link
* @throws Exception
*/
var_dump($list);
}
catch(\Maniaplanet\WebServices\Exception $e)
{
echo "Error!\n";
printf('HTTP Response: %d %s', $e->getHTTPStatusCode(),
$e->getHTTPStatusMessage());
echo "\n";
printf('API Response: %s (%d)', $e->getMessage(), $e->getCode());
echo "\n";
}
echo "\n";
?>
Code: Select all
array(1) { [0]=> object(stdClass)#3 (8) { ["id"]=> string(4) "2194" ["author"]=> string(8) "tm-jinzo" ["dateCreated"]=> string(19) "2014-02-16 22:16:37" ["message"]=> string(44) "Maniaflash for $i$0f0gÄx$000. $fffCommunity" ["link"]=> NULL ["iconStyle"]=> NULL ["iconSubStyle"]=> NULL ["mediaURL"]=> string(0) "" } }
Code: Select all
var_dump($list[0]->id);