draw 0.0.2 copy "draw: ^0.0.2" to clipboard
draw: ^0.0.2 copied to clipboard

outdatedDart 1 only

A Reddit API wrapper for Dart, inspired by PRAW.

DRAW: The Dart Reddit API Wrapper #

Build Status Pub Version

DRAW, also known as the Dart Reddit API Wrapper, is a Dart package that provides simple access to the Reddit API. DRAW is inspired by PRAW, the Python Reddit API Wrapper, and aims to also maintain a similar interface.

This project is in early stages, but is in active development. Check back soon for more info!

Disclaimer: This is not an official Google product.

Installation #

Installing DRAW is simple using Dart's package management system, pub. Instructions on how to import DRAW into your project can be found here. If you would prefer to live on the hemorrhaging-edge, methods to depend on a local copy of DRAW or on the Github repository can be found here.

Getting Started #

Assuming you already have your Reddit OAuth credentials, getting started with DRAW is simple:

import 'dart:async';                                                                                                                                                                                               
import 'package:DRAW/draw.dart';                                                                                                                                                                                   
                                                                                                                                                                                                                   
Future main() async {                                                                                                                                                                                              
  // Create the `Reddit` instance and authenticate                                                                                                                                                                 
  Reddit reddit = await Reddit.createInstance(                                                                                                                                                                     
    clientId: CLIENT_ID,                                                                                                                                                                                           
    clientSecret: SECRET,                                                                                                                                                                                          
    userAgent: AGENT_NAME,                                                                                                                                                                                         
    username: "DRAWApiOfficial",                                                                                                                                                                                   
    password: "hunter12", // Fake                                                                                                                                                                                  
  );                                                                                                                                                                                                               
                                                                                                                                                                                                                   
  // Retrieve information for the currently authenticated user                                                                                                                                                     
  Redditor currentUser = await reddit.user.me();                                                                                                                                                                                                                                                                                                                                                                                      
  // Outputs: My name is DRAWApiOfficial                                                                                                                                                                           
  print("My name is ${currentUser.displayName}");                                                                                                                                                                  
} 

This simple example is a great way to confirm that DRAW is working and that your credentials have been configured correctly.

License #

DRAW is provided under a BSD 3-clause license. Copyright (c), 2017, the DRAW Project Authors and Google LLC.

20
likes
0
pub points
62%
popularity

Publisher

unverified uploader

A Reddit API wrapper for Dart, inspired by PRAW.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, http, ini, oauth2, path, quiver

More

Packages that depend on draw