Browse Source

RIP YQL

Fix #4369
issue_4031
b_b 3 years ago
parent
commit
0af57278ba
  1. 29
      ecrire/iterateur/data.php

29
ecrire/iterateur/data.php

@ -298,13 +298,6 @@ class IterateurDATA implements Iterator {
$this->tableau = $cache['data'];
} else {
try {
# dommage que ca ne soit pas une option de yql_to_array...
if ($this->command['sourcemode'] == 'yql') {
if (!isset($ttl)) {
$ttl = 3600;
}
}
if (isset($this->command['sourcemode'])
and in_array($this->command['sourcemode'],
array('table', 'array', 'tableau'))
@ -632,28 +625,6 @@ function inc_object_to_array($object) {
return array_map('inc_object_to_array', $object);
}
/**
* yql -> tableau
*
* @throws Exception
* @param string $u
* @return array|bool
*/
function inc_yql_to_array_dist($u) {
define('_YQL_ENDPOINT', 'https://query.yahooapis.com/v1/public/yql?&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&q=');
$v = recuperer_url($url = _YQL_ENDPOINT . urlencode($u) . '&format=json');
if (!$v['page']
or !$w = json_decode($v['page'], true)
) {
throw new Exception('YQL: réponse vide ou mal formée');
}
if (isset($w['error'])) {
throw new Exception($w['error']['description']);
}
return inc_object_to_array($w);
}
/**
* sql -> tableau
*

Loading…
Cancel
Save