Giter Club home page Giter Club logo

ducksboard's Introduction

Ducksboard API for .NET

This project contains objects specifically tied to the Ducksboard API, giving you the ability to update your Ducksboard dashboard from your .NET applications. The objects contained here can be used for both Push and Pull APIs. You can sign up for Ducksboard at http://www.ducksboard.com.

*** This project has a dependency on RestSharp ***

Gettings Started

Through Nuget (http://nuget.org):

PM > Install-Package Ducksboard

Somewhere in your code (Push API):

var dashboard = new DucksboardClient("** Your API Key Here **");
var response = dashboard.Update("**widget number**", new Numbers { Value = 3.5 });

Note: the response object will let you know if it was successful in updating. It is not worth looking at unless you are running into issues. I exposed it so you can debug issues more easily.

Supported Widgets

Widget Model Class
Counters Numbers
Gauges Gauges
Absolute Graphs Numbers
Absolute Area Graphs Numbers
Stacked Graphs Numbers
Relative Graphs Numbers
Relative Area Graphs Numbers
Bars Numbers
Boxes Numbers
Pins Numbers
Images Image
Status Status
Texts Text
Timelines Timeline
Leaderboards Leaderboard
Trend Leaderboards TreadLeaderboard
Status Leaderboards StatusLeaderboard
Funnels Funnel
Completion Completion

See http://dev.ducksboard.com/apidoc/slot-kinds/ for the list of widgets and their documentation.

Dashboard API

CRUD operations for Dashboards and widgets have been implemented in the dashboard api.

Example usage :

var dashboardClient = new DashboardClient("** Your API Key Here **");
var dashboard = new Dashboard()
            {
                Name = dashboardName,
                Background = "dark wood",
            };

dashboard = dashboardClient.Create(dashboard);

var leaderboard = client.Create(new Widget()
			{
			    WidgetProperties = new WidgetProperties()
			    {
			        Dashboard = dashboard.Slug,
			        Kind = "custom_textual_status_leaderboard",
			        Sound = true,
			        Title = "My Leaderboard",
			        Width = 1,
			        Height = 2
			    },
			    Slots = new Slot
			    {
			        Slot1 = new SlotData
			            {
			                Subtitle1 = "Thing",
			                Color1 = Color.DarkSlateBlue.ToDucksboardColor(),
			                Subtitle2 = "Status",
			                Color2 = Color.Black.ToDucksboardColor()
			            }
			    }
			});


leaderboard.Slots.Slot1.Label = "MySlotLabel";

dashboardCient.Update(leaderboard, leaderboard.Slug);

Supported Objects

  • Dashboards
  • Widgets

NOTE: Currently widget content is not supported. Any of the http://dev.ducksboard.com/apidoc/widgets-list/#custom-widgets Custom widgets can be used.

ASP.NET and Pull API

Using the pull API is very simple, you just need to provide Ducksboard with a url to pull from and provide the same JSON you would push to them. Below is a quick example with ASP.NET MVC.

  // imagine this is in your publicly accessible controller
  public ActionResult Tickets() {
    var numOfTickets = db.Tickets.Count();
    return Content(new Numbers { Value = numOfTickets }.ToJson());  
  }

ToJson() is a member method of all Ducksboard objects, so you can use it anywhere you can host a web process.

Contributors

Pull Requests

Feel free to fork this project and send me a pull request, if you can create a unit test that would be great as well.

ducksboard's People

Contributors

btompkins avatar khalidabuhakmeh avatar xps avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.