Skip to content

Commit 0340696

Browse files
devoncarewCommit Bot
authored and
Commit Bot
committed
[pkg/analysis_server] remove code referencing itsallwidgets.com
Change-Id: Ic7b93eaaef6cb35395d47af5603e095250048d77 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245740 Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Devon Carew <[email protected]>
1 parent 8f81740 commit 0340696

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

pkg/analysis_server/tool/code_completion/corpus.dart

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import 'dart:convert';
66
import 'dart:io';
77

88
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;
119
import 'package:path/path.dart' as path;
1210

1311
/// Generate or update corpus data.
@@ -63,7 +61,6 @@ final updateExistingClones = false;
6361

6462
final _appDir =
6563
path.join(_homeDir, 'completion_metrics', 'third_party', 'apps');
66-
final _client = http.Client();
6764

6865
final _homeDir = Platform.isWindows
6966
? Platform.environment['LOCALAPPDATA']!
@@ -90,12 +87,6 @@ Future<CloneResult> _clone(String repo) async {
9087
return CloneResult(result.exitCode, cloneDir, msg: result.stderr as String);
9188
}
9289

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-
9990
bool _hasPubspec(FileSystemEntity f) =>
10091
f is Directory &&
10192
File(path.join(f.path, file_paths.pubspecYaml)).existsSync();
@@ -130,38 +121,3 @@ class CloneResult {
130121
final String msg;
131122
CloneResult(this.exitCode, this.directory, {this.msg = ''});
132123
}
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

Comments
 (0)