pinboard 1.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

Pinboard for Dart #

A library that provides a nice interface to communicate with the Pinboard API. The library is essentially a typed wrapper to Pinboard's API, meaning that it sometimes does things that don't quite make sense. Blame Pinboard.

Usage #

You can view a complete example of the available API in the example. You can also view the documentation, although it's a little verbose.

1.1.0 #

  • Added errors from the Pinboard API

1.0.0 #

  • Initial version, created by Stagehand

example/pinboard_example.dart

import 'package:pinboard/pinboard.dart';

main() async {
  var client = Pinboard(username: 'test');
  await client.loginWithPassword(password: 'password123');

  // You can also create a client with a token if you happen to have one.
  // var client = Pinboard(username: 'dstaley', token: 'rubbadubdub');

  // Posts
  // Returns the most recent time a bookmark was added, updated or deleted.
  var lastUpdate = await client.posts.update();

  // Add a bookmark.
  var addPostResponse = await client.posts.add(
    url: 'https://getfirefox.com',
    description: 'Download Firefox — Free Web Browser — Mozilla',
    extended: 'The last remaining non-corporate web browser',
    tag: 'web-browser software open-source',
    dt: DateTime.parse('2018-12-25'),
    replace: false,
    shared: true,
    toread: false,
  );

  // Delete a bookmark.
  var deletePostResponse = await client.posts.delete(
    url: 'https://getfirefox.com',
  );

  // Returns one or more posts on a single day matching the arguments. If no
  // date or url is given, date of most recent bookmark will be used.
  var filteredPosts = await client.posts.get(
    tag: 'software',
    dt: DateTime.parse('2018-12-25'),
    url: 'https://getfirefox.com',
    meta: true,
  );

  // Returns a list of the user's most recent posts, filtered by tag.
  var recentPosts = await client.posts.recent(
    tag: 'software',
    count: 5,
  );

  // Returns a list of the user's most recent posts, filtered by tag.
  var dates = await client.posts.dates(
    tag: 'software',
  );

  // Returns all bookmarks in the user's account.
  var allPosts = await client.posts.all(
    tag: 'software',
    start: 10,
    results: 5,
    fromdt: DateTime.parse('2018-01-01'),
    todt: DateTime.parse('2018-12-31'),
    meta: 1,
  );

  // Returns a list of popular tags and recommended tags for a given URL.
  // Popular tags are tags used site-wide for the url; recommended tags are
  // drawn from the user's own tags.
  var suggestedTags = await client.posts.suggest(
    url: 'https://getfirefox.com',
  );

  // Tags
  // Returns a full list of the user's tags along with the number of times they
  // were used.
  var allTags = await client.tags.get();

  // Delete an existing tag.
  var deleteTagResponse = await client.tags.delete(
    tag: 'software',
  );

  // Rename an tag, or fold it in to an existing tag.
  var renameTagResponse = await client.tags.rename(
    old: 'open-source',
    new_: 'opensource',
  );

  // User
  // Returns the user's secret RSS key (for viewing private feeds).
  var secret = await client.user.secret();

  // Returns the user's API token (for making API calls without a password).
  var apiToken = await client.user.api_token();

  // Notes
  // Returns a list of the user's notes.
  var allNotes = await client.notes.list();

  // Returns an individual user note.
  var note = await client.notes.get(id: '14b66dd2cd8b7d70f1d1');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pinboard: ^1.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pinboard/pinboard.dart';
  
Version Uploaded Documentation Archive
1.1.1 Dec 28, 2018 Go to the documentation of pinboard 1.1.1 Download pinboard 1.1.1 archive
1.1.0 Dec 28, 2018 Go to the documentation of pinboard 1.1.0 Download pinboard 1.1.0 archive
1.0.1 Dec 28, 2018 Go to the documentation of pinboard 1.0.1 Download pinboard 1.0.1 archive
1.0.0 Dec 28, 2018 Go to the documentation of pinboard 1.0.0 Download pinboard 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15

Platforms

Detected platforms: Flutter, other

Primary library: package:pinboard/pinboard.dart with components: io.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0 0.12.0+2
meta ^1.1.6 1.1.7
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
pedantic 1.6.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
coverage ^0.12.3
duvet ^0.0.1
test ^1.0.0