@@ -6,8 +6,6 @@ import 'dart:convert';
6
6
import 'dart:io' ;
7
7
8
8
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
9
- import 'package:html/parser.dart' show parse;
10
- import 'package:http/http.dart' as http;
11
9
import 'package:path/path.dart' as path;
12
10
13
11
/// Generate or update corpus data.
@@ -63,7 +61,6 @@ final updateExistingClones = false;
63
61
64
62
final _appDir =
65
63
path.join (_homeDir, 'completion_metrics' , 'third_party' , 'apps' );
66
- final _client = http.Client ();
67
64
68
65
final _homeDir = Platform .isWindows
69
66
? Platform .environment['LOCALAPPDATA' ]!
@@ -90,12 +87,6 @@ Future<CloneResult> _clone(String repo) async {
90
87
return CloneResult (result.exitCode, cloneDir, msg: result.stderr as String );
91
88
}
92
89
93
- Future <String > _getBody (String url) async => (await _getResponse (url)).body;
94
-
95
- Future <http.Response > _getResponse (String url) async =>
96
- _client.get (Uri .parse (url),
97
- headers: const {'User-Agent' : 'dart.pkg.completion_metrics' });
98
-
99
90
bool _hasPubspec (FileSystemEntity f) =>
100
91
f is Directory &&
101
92
File (path.join (f.path, file_paths.pubspecYaml)).existsSync ();
@@ -130,38 +121,3 @@ class CloneResult {
130
121
final String msg;
131
122
CloneResult (this .exitCode, this .directory, {this .msg = '' });
132
123
}
133
-
134
- class RepoList {
135
- static const itsallwidgetsRssFeed = 'https://itsallwidgets.com/app/feed' ;
136
-
137
- // (Re) generate the list of github repos on itsallwidgets.com
138
- static Future <List <String >> fromItsAllWidgetsRssFeed () async {
139
- final repos = < String > {};
140
-
141
- final body = await _getBody (itsallwidgetsRssFeed);
142
- final doc = parse (body);
143
- final entries = doc.querySelectorAll ('entry' );
144
- for (var entry in entries) {
145
- final link = entry.querySelector ('link' );
146
- if (link == null ) {
147
- continue ;
148
- }
149
- final href = link.attributes['href' ];
150
- if (href == null ) {
151
- continue ;
152
- }
153
- final body = await _getBody (href);
154
- final doc = parse (body);
155
- final links = doc.querySelectorAll ('a' );
156
- for (var link in links) {
157
- final href = link.attributes['href' ];
158
- if (href != null && href.startsWith ('https://github.com/' )) {
159
- print (href);
160
- repos.add (href);
161
- continue ;
162
- }
163
- }
164
- }
165
- return repos.toList ();
166
- }
167
- }
0 commit comments