machek/mmyql

Zend Framework 2模块,方便访问YQL(Yahoo!查询语言)

dev-master 2013-05-04 22:04 UTC

This package is not auto-updated.

Last update: 2024-09-23 11:22:31 UTC


README

版本 0.01 由Zdenek Machek在2013年Yahoo! Hack Europe:伦敦期间创建

简介

这是一个简化YQL - Yahoo!查询语言(http://developer.yahoo.com/yql/)使用的简单模块

要求

安装

  1. "machek/mmyql": "dev-master" 添加到您的 composer.json 文件中,并运行 php composer.phar update
  2. MMYQL 添加到您的 config/application.config.php 文件中的 modules 键下。
  3. 将 /vendor/machek/mmyql/configmmyql.local.php.dist 复制到 /config/autoload/mmyql.local.php

使用方法

		$select = "latitude, longitude, radius";
        $from = "geo.placefinder";
        $where = "text=\"{$query}\"";

        $response = $this->getServiceLocator()->get('serviceYQL')->executeQuery($select, $from, $where);
        $responseArray = json_decode($response);
        $resultArray = array('coordinates' => array('latitude' => $result->latitude, 'longitude' => $result->longitude, 'radius' => $result->radius));

或者查看我们使用它的这个项目: https://github.com/Gisleburt/yahoohack