OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of search_engine; | 5 part of search_engine; |
6 | 6 |
7 | 7 |
8 class StackOverflowSearchEngine implements SearchEngine { | 8 class StackOverflowSearchEngine implements SearchEngine { |
9 String get name => 'StackOverflow'; | 9 String get name => 'StackOverflow'; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 json['items'].take(3).forEach((item) { | 33 json['items'].take(3).forEach((item) { |
34 controller.add(new SearchResult( | 34 controller.add(new SearchResult( |
35 item['title'], item['link'])); | 35 item['title'], item['link'])); |
36 }); | 36 }); |
37 }) | 37 }) |
38 .catchError(controller.addError) | 38 .catchError(controller.addError) |
39 .whenComplete(controller.close); | 39 .whenComplete(controller.close); |
40 return controller.stream; | 40 return controller.stream; |
41 } | 41 } |
42 } | 42 } |
OLD | NEW |