<?php
/**************************************************
*  Created:  2010-06-08
*
*  新浪短链接
*
*  @Xweibo (C)1996-2099 SINA Inc.
*  @Author xionghui <xionghui1@staff.sina.com.cn>
*
***************************************************/

class sinaurl 
{
	/**
	 * 获取 sinaurl.cn 短网址的相关消息
	 */
	function default_action() {
		//获取要查询的ID，以逗号分隔
		$url_id = V('r:id');
		
		//var_dump($url_id);
		
		$http = APP::ADP('http');
		
		$result = $http->setUrl(SINAURL_INFO)->setData('url=' . $url_id)->request();

		if ($http->getState() == 200) {
			//APP::ajaxRst(json_decode($result));
			echo $result;
		}
		else {
			echo '{code: -1}';
		}
		exit;
	}
	
	function test(){
		$callback = V('g:cb', '');
		//echo $callback;
		echo "{errno:0}";
	}
}