Skip to content

Instantly share code, notes, and snippets.

Datasink Overview

The datasink type is meant to allow a greater flexibility for the end-user. Instead of requiring the user to display data from Facebook, Instagram, Twitter and RSS in different apps, a Data Sink can be linked with any Data Source that provides the required fields.

Data Sources are a new feature of OnSign TV. This type is one of the most complex, because it allows the end user to provide data in a structured table format, either manually inputing data or automatically pulling it from Facebook, Instagram, Twitter, RSS and even another Data Source. Every entry in the Data Source can be edited and moderated by the end user, allowing total control of what is displayed in the app.

It is up to you, the app developer, to specify what kinds of data you are going to display. For instance, a "News App" might require a news title, news body, news image and publication date. But a "Menu Board App" it might only require a menu item name and price. Your task is to specify in the app w

@classmethod
def update_source(self, data_source_rows_by_guid, update_data_source_groups):
histories_to_save = []
for guid, datasources in update_data_source_groups.items():
user_edited_entries_values = defaultdict(list)
for history in DataSourceHistory.objects.filter(datasource_id__in=[ds.id for ds in datasources],
is_user_action=True).distinct('row_id'):
user_edited_entries_values[history.datasource_id].append(history.values)
for ds in datasources:
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>G1 > Loterias</title>
<link>http://g1.globo.com/loterias/index.html</link>
<description>
Veja no G1 Loterias os resultados dos últimos concursos da Mega-Sena, Dupla Sena, Loteria Federal, Loteca, Lotofacil, Lotogol, Lotomania, Quina e Timemania.
</description>
<language>pt-BR</language>
<copyright>© Copyright Globo Comunicação e Participações S.A.</copyright>
<atom:link href="http://pox.globo.com/rss/g1/loterias/" rel="self" type="application/rss+xml"/>

Type Datasink

The datasink type allows the user to link a data source file with the app and makes it available to be rendered as HTML5. This type is one of the most complex, in which is possible to feed the app with user`s own data or highly menageable third party data.

Data Source

The Data Source is file where will be possible to manage the data available to the app throw the datasink. The data in this file, can be inserted by the user, or came from another source like a RSS, Instagram or Facebook. Every entry in the Data Source file is totally manageable by the user, it can by accepted, refused, deleted or even modified.

datasink Attributes