Skip to content

Commit f026b49

Browse files
committed
Remove multiset per Quandls deprecation
1 parent cbff517 commit f026b49

File tree

4 files changed

+8
-68
lines changed

4 files changed

+8
-68
lines changed

Quandl.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class Quandl {
1414

1515
private static $url_templates = [
1616
"symbol" => 'https://www.quandl.com/api/v1/datasets/%s.%s?%s',
17-
"symbols" => 'https://www.quandl.com/api/v1/multisets.%s?columns=%s&%s',
1817
"search" => 'https://www.quandl.com/api/v1/datasets.%s?%s',
1918
"list" => 'http://www.quandl.com/api/v2/datasets.%s?%s',
2019
];
@@ -33,18 +32,6 @@ public function getSymbol($symbol, $params=null) {
3332
return $this->getData($url);
3433
}
3534

36-
// getSymbols returns data for an array of symbols.
37-
// Symbols may be in slash or dot notation and may include
38-
// column specifier.
39-
public function getSymbols($symbols, $params=null) {
40-
$url = $this->getUrl("symbols",
41-
$this->getFormat(),
42-
self::convertSymbolsToMulti($symbols),
43-
$this->arrangeParams($params));
44-
45-
return $this->getData($url);
46-
}
47-
4835
// getSearch returns results for a search query.
4936
// CSV output is not supported with this node so if format
5037
// is set to CSV, the result will fall back to object mode.
@@ -162,16 +149,6 @@ private function arrangeParams($params) {
162149
private static function convertToQuandlDate($time_str) {
163150
return date("Y-m-d", strtotime($time_str));
164151
}
165-
166-
// convertSymbolsToMulti converts an array of symbols to
167-
// the format needed for a multiset request.
168-
private static function convertSymbolsToMulti($symbols_array) {
169-
$result = [];
170-
foreach($symbols_array as $symbol) {
171-
$result[] = str_replace("/", ".", $symbol);
172-
}
173-
return implode(",", $result);
174-
}
175152
}
176153

177154
?>

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ any date string that PHP's `strtotime()` understands.
5050
"trim_end" => "today",
5151
]);
5252

53-
Multiple symbols, supported symbols and search methods are also
54-
available:
53+
You can also search the entire Quandl database and get a list of
54+
supported symbols in a data source:
5555

5656
$quandl = new Quandl($api_key);
57-
$data = $quandl->getSymbols(["WIKI/AAPL", "WIKI/CSCO"]);
5857
$data = $quandl->getSearch("crude oil");
5958
$data = $quandl->getList("WIKI", 1, 10);
6059

@@ -106,20 +105,6 @@ You do not need to pass `auth_token` in the array, it will be
106105
automatically appended.
107106

108107

109-
### getSymbols
110-
111-
`mixed getSymbols( array $symbols [, array $params ] )`
112-
113-
Same as `getSymbol()` only instead of a single symbol, it receives
114-
an array of multiple symbols. Each symbol in the array may be
115-
listed using the slash notation (`WIKI/AAPL`) or dot notation
116-
(`WIKI.AAPL`).
117-
118-
In addition, you may append the column selector to each symbol in
119-
order to get only selected columns. For example, `WIKI/AAPL.4` will
120-
return only the close prices (column 4) of AAPL.
121-
122-
123108
### getSearch
124109

125110
`mixed getSearch( string $query [, int $page, int $per_page] )`

examples.php

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$symbol = "GOOG/NASDAQ_AAPL";
99

1010
// Uncomment and modify this call to check different samples
11-
// $data = example9($api_key, $symbol);
11+
// $data = example3($api_key, $symbol);
1212
// print_r($data);
1313

1414
// Example 1: Hello Quandl
@@ -53,34 +53,20 @@ function example5($api_key, $symbol) {
5353
]);
5454
}
5555

56-
// Example 6: Multiple Symbols
56+
// Example 6: Search
5757
function example6($api_key, $symbol) {
58-
$quandl = new Quandl($api_key, "csv");
59-
return $quandl->getSymbols(["GOOG/NASDAQ_AAPL", "GOOG/NASDAQ_CSCO"]);
60-
}
61-
62-
// Example 7: Multiple Symbols with Column Selector and Options
63-
function example7($api_key, $symbol) {
64-
$quandl = new Quandl($api_key, "csv");
65-
$symbols = ["GOOG/NASDAQ_AAPL.4", "GOOG/NASDAQ_CSCO.4"];
66-
$options = ["rows" => 10];
67-
return $quandl->getSymbols($symbols, $options);
68-
}
69-
70-
// Example 8: Search
71-
function example8($api_key, $symbol) {
7258
$quandl = new Quandl($api_key);
7359
return $quandl->getSearch("crude oil");
7460
}
7561

76-
// Example 9: Symbol Lists
77-
function example9($api_key, $symbol) {
62+
// Example 7: Symbol Lists
63+
function example7($api_key, $symbol) {
7864
$quandl = new Quandl($api_key, "csv");
7965
return $quandl->getList("WIKI", 1, 10);
8066
}
8167

82-
// Example 10: Error Handling
83-
function example10($api_key, $symbol) {
68+
// Example 8: Error Handling
69+
function example8($api_key, $symbol) {
8470
$quandl = new Quandl($api_key, "csv");
8571
$result = $quandl->getSymbol("DEBUG/INVALID");
8672
if($quandl->error and !$result)

tests/QuandlTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ public function testInvalidUrl() {
3737
"TEST invalidUrl response");
3838
}
3939

40-
public function testGetSymbols() {
41-
$quandl = new Quandl($this->api_key, "json");
42-
$r = $quandl->getSymbols($this->symbols, $this->dates);
43-
$sig = md5($r);
44-
$this->assertEquals("56fdde06b1cc699286b2e3bdaaf40761", $sig,
45-
"TEST getSymbols checksum");
46-
}
47-
4840
public function testGetList() {
4941
$quandl = new Quandl($this->api_key);
5042
$r = $quandl->getList("WIKI", 1, 10);

0 commit comments

Comments
 (0)