/vb_noticeboard

A simple Dart wrapper for fetching, parsing and extracting notices from Visva-Bharati, Santiniketan's Official website

Primary LanguageDartMIT LicenseMIT

vb_noticeboard

A simple Dart wrapper for fetching, parsing and extracting notices from Visva-Bharati, Santiniketan's Official website

Show some ❤️ by putting

This plugin is readily available for use.

what does it do ?

  • Can fetch list of notices from Visva-Bharati, Santiniketan's Official Website
  • Parse them and extract them from html page
  • Clean up data and convert it to Map<String, Map<String, String>>
  • Can store processed data in JSON file
  • Can read data back from JSON file and convert it to Map<String, Map<String, String>>, so that it can be used again

how to use it ?

Fetching Notices :

FetchNotice().fetch().then(
        (value) {
            // more code coming
        },
        onError: (e) => print(e),
      );

Parsing HTML page to Map<String, Map<String, String>> :

ParseNotice().parseIt(value);

Storing parsed Notices :

StoreNotice.storeIt('data.json', ParseNotice().parseIt(value)).then(
        (val) => print(val ? 'Success' : 'Failure'),
        onError: (e) => print(e),
);

Extracting Notices from JSON :

ExtractFromJson.extractIt('data.json').then(
    (data) => print(data),
    onError: (e) => print(e),
);

Merging up all of them :

FetchNotice().fetch().then(
        (value) =>
            StoreNotice.storeIt('data.json', ParseNotice().parseIt(value)).then(
              (val) => print(val ? 'Success' : 'Failure'),
              onError: (e) => print(e),
            ),
        onError: (e) => print(e),
      );

ExtractFromJson.extractIt('data.json').then(
    (data) => print(data),
    onError: (e) => print(e),
    );

Make sure you've imported vb_noticeboard.dart

import 'package:vb_noticeboard/vb_noticeboard.dart';

Hoping it was helpful 😄