Displaying Results with Popfly

We can now create a poll, get the responses to the poll, and tabulate the totals, so we need a way to display them on the screen. To do this we will use a custom Popfly component that will be embedded into a web page.

Popfly (http://www.popfly.com/) allows users with little to no programming experience to create web mashups. A mashup is a web application that can take data from multiple sources and combine it in some fashion to make a single application.

Popfly's main interface consists of dragging large blocks to a surface, configuring those blocks for a specific task, and then connecting the outputs and inputs of those blocks so data will flow and be transformed into a final goal.

The component we are going to build is currently publicly shared at http://www.popfly.com/users/c4fbook/TwitterVoteGraph, so we can use that directly. To build your own Popfly component for displaying the results, just follow the directions in this section.

Our final Popfly mashup will look like that shown in Figure 6-4.

Complete Popfly mashup for TwitterVoteGraph

Figure 6-4. Complete Popfly mashup for TwitterVoteGraph

To create this, start by making a new mashup in Popfly. Search in the left "Blocks" pane for the User Input block, and drag two instances of the block to the mashup area. Do the same for the Text Helper, ArrayUtil, and Bar Graph blocks, and connect them as shown in Figure 6-4.

Next, we need to configure the ...

Get Coding4Fun now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.