Skip to content

Instantly share code, notes, and snippets.

@codeboost
Last active March 3, 2016 17:58
Show Gist options
  • Save codeboost/257d6d36b7eb87746ea3 to your computer and use it in GitHub Desktop.
Save codeboost/257d6d36b7eb87746ea3 to your computer and use it in GitHub Desktop.
All data is contained in one big file, for example:
http://www.boomhub.org/db/results.json
All the nodes are stored in the root of the json, with the url paths as keys.
Each node has a "type" field.
Type can be "section" or "article".
Section node
A section node has a "links" field, which is an array of "link" nodes.
Each link contains a "href" field, a imageURL and a title field.
These fields are displayed by the app when visualizing a section.
Here is a sample "section" node
"boomguide": {
type: "section"
links: [
{
href: "boomguide/location/",
imageURL: "1029/bf16_boomguide_gettingto_950x450.564x264.jpg",
title: "How To Get To Boomland"
},
{
href: "boomguide/a-nice-boom/",
imageURL: "1044/copia.564x264.jpg",
title: "A Nice Boom & FAQ"
}]
}
Article nodes.
An article node has the following fields:
"news/who-makes-boom/" : {
type: "article",
className: "columns sixteen detail news",
imageURL: "/boom2016/site/assets/files/2493/bf16_whomakesboom_950x450.950x450.jpg",
title: "Who Makes Boom?",
body: "<div>html data here</div>"
}
===
How the app displays articles:
Create a local WebView control
Load "article.html". "article.html" is bundled with the application and contains the skeleton for a article page:
https://github.com/codeboost/Boom2016-iOS/blob/master/Boom/html/article.html
Set the page content, by executing these javascript functions:
setArticleClassNames(node.className)
setTopImage(node.imageURL)
setArticleTitle(node.title)
setArticleBody(node.body)
The article.html page uses the same css file as the boom festival website,
so the articles should look the same as on the web page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment