@@ -13,7 +13,6 @@ import 'package:clock/clock.dart';
1313import 'package:collection/collection.dart' ;
1414import 'package:gcloud/service_scope.dart' as ss;
1515import 'package:gcloud/storage.dart' ;
16- import 'package:html/parser.dart' as html_parser;
1716import 'package:logging/logging.dart' ;
1817import 'package:meta/meta.dart' ;
1918// ignore: implementation_imports
@@ -441,47 +440,6 @@ class SearchBackend {
441440 return rs.body;
442441 }
443442
444- /// Downloads the remote SDK page and tries to extract the first paragraph of the content.
445- Future <String ?> _fetchSdkLibraryDescription ({
446- required Uri baseUri,
447- required String relativePath,
448- }) async {
449- try {
450- final content = await fetchSdkIndexContentAsString (
451- baseUri: baseUri, relativePath: relativePath);
452- final parsed = html_parser.parse (content);
453- final descr = parsed.body
454- ? .querySelector ('section.desc.markdown' )
455- ? .querySelector ('p' )
456- ? .text
457- .trim ();
458- return descr == null ? null : compactDescription (descr);
459- } catch (e) {
460- _logger.info (
461- 'Unable to fetch SDK library description $baseUri $relativePath ' , e);
462- return null ;
463- }
464- }
465-
466- /// Downloads the remote SDK page and tries to extract the first paragraph of the content
467- /// for each library in [libraryRelativeUrls] .
468- Future <Map <String , String >> fetchSdkLibraryDescriptions ({
469- required Uri baseUri,
470- required Map <String , String > libraryRelativeUrls,
471- }) async {
472- final values = < String , String > {};
473- for (final library in libraryRelativeUrls.keys) {
474- final descr = await _fetchSdkLibraryDescription (
475- baseUri: baseUri,
476- relativePath: libraryRelativeUrls[library]! ,
477- );
478- if (descr != null ) {
479- values[library] = descr;
480- }
481- }
482- return values;
483- }
484-
485443 Future <List <PackageDocument >?> fetchSnapshotDocuments () async {
486444 try {
487445 final map = await _snapshotStorage.getContentAsJsonMap ();
0 commit comments