DIY: Liferay Events Hacks: Part 2

A community challenge for you

Liferay's worldwide conferences generate quite a bit of data, and I am challenging the community: Take this data, and do something more interesting than a boring list of speakers and rooms. Get creative with the data (it's super-easy to digest, see the example code from my first post). Have some fun and show us how creative you can get!

What's In It For Me?

You'll win one of these:

  • Gratitude from our community and recognition from your peers that you are indeed a rockstar hacker (and a small gift from Liferay), or
  • A Tesla1

Not sure which one will be given away yet. We're still working out the details.

The Details

Liferay holds many events throughout the year, and there is a lot of data associated with them. Hundreds of speakers, sessions, and activities across global venues means a lot of data, and in a previous blog post I challenged you to take our open data stream and do something interesting with it. In that post, I documented the data related to sessions, speakers, rooms, maps, activities, sponsors, etc, and gave some example JavaScript you can copy/paste into your browser's developer console to see just how easy it is. And it's all available to you and your creative minds!

Now it's time to look at some even more interesting data: iBeacons!

If you've attended some of our recent Liferay conferences (or you're planning on attending future events), you've probably heard of iBeacons. We've been using them in several events to showcase Liferay as a mobile engagement platform and to provide value to attendees by engaging them with location and time-sensitive notifications (e.g. when walking out of a breakout session, you'll receive helpful followup information about related sessions, and a plea to provide feedback).

The way it works is pretty simple: the Liferay Events mobile app knows about these little Bluetooth transmitters we hide throughout venues (if you look around, you might spot them!). When you walk into or out of range of each beacon, or linger in a given area, the app knows what you're doing and will provide interactive notifications to you based on your movement.

But there's more -- the app also periodically records (anonymous) data regarding how many devices are within range of each beacon. Although this makes Olaf's tinfoil hat buzz with doubt and uncertainty, you (and Olaf) can rest assured we do not record anything private or identifying - it's totally anonymous.

And the best part -- the data is open for you to browse, process, and have fun with. And therein lies this challenge: channel your inner analytic/visualization geek, hook up to the data, and show everyone something interesting! It doesn't have to be enterprise-grade, bulletproof, fully cooked, or ready for deployment into production. But if it's interesting and fun, I'll do my best to show off your creation in our community.

Don't forget, the agenda/speakers/sessions/rooms data is already documented. What follows a description of the iBeacon data.

The iBeacon Data

iBeacon data can be retrieved using a JSON endpoint and specifying the event for which you want data (and optionally a time of day filter to reduce how much data you want or do realtime monitoring). You can also retrieve data for a past event or a current event (e.g. for a realtime dashboard). The event specifiers for 2014 that might have data:

  • lpsf-benelux-2014 (Benelux Solutions Forum)
  • lrfs2014 (France Symposium)
  • lr-nas-2014 (North America Symposium)
  • spain2014 (Spain Symposium)
  • lpsf-uk-2014 (UK Solutions Forum)
  • lpsf-de-2014 (Germany Solutions Forum)
  • devcon-2014 (Liferay Developer Conference)
  • brazil2014 (Brazil Symposium)
  • italy2014 (Italy Symposium)

Example URLs

1. Get all the iBeacon data for the Benelux Solutions Forum:

http://mdata.liferay.com/html/mdata-public/liferay-beacons-service-get.jsp?event=lrfs2014

2. Get all the iBeacon data for the France Symposium, but only starting at 1402583699000 (which is Thu, 12 Jun 2014 14:34:59 GMT)

http://mdata.liferay.com/html/mdata-public/liferay-beacons-service-get.jsp?event=lrfs2014&from=1402583699000

3. Get all the iBeacon data from the France Symposium between 1402583699000 and 1402583799000 (i.e. from Thu, 12 Jun 2014 14:34:59 GMT through Thu, 12 Jun 2014 14:36:39 GMT, about 2 seconds worth):

http://mdata.liferay.com/html/mdata-public/liferay-beacons-service-get.jsp?event=lrfs2014&from=1402583699000&to=1402583799000

The first example should give you 3239 results, the second about 600, and the third about 6 results. Note that some events do not yet have any data, because the event has not yet taken place. But you can use prior events for testing purposes!

The result object is always a JSON object that has a status code (stat) to indicate success or not. The code is either ok (meaning success), or something else (indicating failure). So check the stat code before doing anything else. E.g. here's an error:

{
  "stat": "error: something is horribly wrong"
}

And here's what success looks like:

{
  "stat" : "ok",
  "size" : <size of result set>,
  "from": <earliest timestamp of result set, or specific "from" time if you gave one>,
  "to": <last timestamp, or specific "to" time if you gave one>,
  "resultSet": <JSON ARRAY OF RESULTS>
}

The resultSet is itself a JSON Array.. of results. It looks like:


[
    {
        "id": "8f6ac3d0f22afa59",
        "date": 1402583703156,
        "beacons": [
            {
                "proximity": "far",
                "beacon_name": "Mystery Object 4"
            },
            {
                "proximity": "immediate",
                "beacon_name": "Mystery Object 1"
            },
            {
                "proximity": "far",
                "beacon_name": "Mystery Object 3"
            },
            {
                "proximity": "near",
                "beacon_name": "Mystery Object 2"
            }
        ],
        "regions": ["Venue", "Salon Bonaparte"]
    },
    <more results>,...
]

The entries in each array element of the resultSet:

  • id: A unique id (corresponding to a unique install of the app; if you reinstall the app you get a new id)
  • date: The timestamp of the ping
  • regions: a JSON Array of regions that the device was "in" at the time of the ping
  • beacons: a JSON Array of individual beacons that the device could "see" at the time of the ping. A proximity to each beacon is also included (immediate, near, or far)

To understand what a beacon region vs. individual beacon is, read this blog post!

So there you have it - what are you going to do with it?

----

1Tesla joke shamelessly stolen from Henry Nakamura

 

Blogs