Data Plugs are bits of software which retrieve individual’s data (well basically our personal data) from data sources on the Internet (e.g. Facebook) into the HAT. HAT Data Plugs available are written in Scala/Play.
Data Plugs in the HAT ecosystem are self-contained services that act between a service providing data and a HAT. This project provides reusable libraries and structures for building such Data Plugs as well as examples of already built ones.
How to build a new Data Plug (Twitter data plug as an example)
Taking Twitter as an example, this plug implemented a data plug built on the Scala/Play framework
- ‘commonPlay’ as a set of various reusable blocks of code and libraries
- ‘data plug’ the core components of any Data Plug
Using convenient API wrappers served as HAT Library Artifacts:
- ‘hat-client-scala-play’ as a Scala wrapper around the HAT HTTP API
- ‘marketsquare-client-scala-play’ as a Scala wrapper around the HATDeX MarketSquare HTTP API
Facebook Data Plug
Facebook Data Plug uses the Graph API to get data out of Facebook’s platform to the individual’s HAT. The Graph API is a ‘social graph’, which represents all data on Facebook as: * nodes, which are Things like, for example, a user or a page * fields, which contain info about the things like, for example, user’s name or birthday * edges, which connect the things like, for example, comments on user’s photos
Currently supported nodes within the HAT are: Facebook user’s profile (such as name, age, etc), posts and events. Future development will feature more updates from a user’s such as likes, check-ins, travels and other connect services like Spotify. More information about Facebook Graph API can be found here.
Dropbox Photo Data Plug
Dropbox Data Plug currently uses Dropbox API to create metalinks to individual’s photos on Dropbox. This allows user to view his/her photos directly from the HAT, while the photos themselves are kept in the Dropbox storage. More information about the Dropbox API can be found here.
iCal Calendar Data Plug
Calendar Data Plug employs iCalendar file format allowing individuals to collect their calendar information back into their hats. iCalendar Data synchronisation within the HAT is initialised by entering the user’s ics calendar url into the form and submitting it. How you obtain your calendar URL depends on your calendar provider. For example, for Google calendar visit this. Currently iCal Calendar Data Plug extracts a simple set of individuals’ calendar event information, using ical.js (https://github.com/mozilla-comm/ical.js) library: event name, event start and end dates, “last updated” timestamp, event location, attendees, summary, description and organiser. For more information about iCalendar, please visit this.