@@ 52-64 (lines=13) @@ | ||
49 | * @return array |
|
50 | * @throws Exception |
|
51 | */ |
|
52 | private function search(Request $request, $value) |
|
53 | { |
|
54 | $response = $request->create($this->vendor->generateUrl($value)); |
|
55 | ||
56 | if (is_null($response)) { |
|
57 | throw new Exception("Request to Itunes API failed", $request->getStatusCode()); |
|
58 | } |
|
59 | ||
60 | return [ |
|
61 | 'search' => $response, |
|
62 | 'status' => true, |
|
63 | ]; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @param string $feedUrl |
|
@@ 104-116 (lines=13) @@ | ||
101 | * @return array |
|
102 | * @throws Exception |
|
103 | */ |
|
104 | private function read(Request $request, $feedUrl) |
|
105 | { |
|
106 | $output = $request->create($feedUrl); |
|
107 | ||
108 | if (is_null($output)) { |
|
109 | throw new Exception("Request to RSS failed", $request->getStatusCode()); |
|
110 | } |
|
111 | ||
112 | return [ |
|
113 | 'feed' => $output, |
|
114 | 'status' => true, |
|
115 | ]; |
|
116 | } |
|
117 | ||
118 | /** |
|
119 | * @param string $feedUrl |