Skip to content

Instantly share code, notes, and snippets.

@sketchytech
sketchytech / apple_news.php
Last active March 23, 2016 13:28
Apple News Format: Basic PHP Parser
<?php
function appleNewsFormatToHTML($filename) {
if (file_exists($filename)) {
$json = file_get_contents($filename);
$obj = json_decode($json, true);
$comp = $obj['components'];
$count = count($comp);
$i = 0;
$article = '<html>';
@sketchytech
sketchytech / article.json
Created March 22, 2016 15:57
Apple News Format: Link Addition (Hyperlink)
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [{
"role": "title",
"text": "My First Article",
"textStyle": "titleStyle"
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:08
Apple News Format: Embed a Tweet
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [{
"role": "title",
"text": "My First Article"
}, {
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:09
Apple News Format: Metadata
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [{
"role": "title",
"text": "My First Article"
}, {
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:11
Apple News Format: Document Style
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [
{
"role": "title",
"text": "My First Article"
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:12
Apple News Format: Text Styles (Character Formatting)
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [{
"role": "title",
"text": "My First Article",
"textStyle": "titleStyle",
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:12
Apple News Format: Inline Text Styles
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [{
"role": "title",
"text": "My First Article",
"textStyle": "titleStyle",
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:13
Apple News Format: Using Markdown
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [
{
"role": "title",
"text": "My First Article",
@sketchytech
sketchytech / article.json
Last active March 24, 2016 10:56
Apple News Format: Adding Component Text Styles
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [
{
"role": "title",
"text": "My First Article",
@sketchytech
sketchytech / article.json
Last active March 22, 2016 16:13
Apple News Format: Basic Structure
{
"version": "1.1",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [
{
"role": "title",
"text": "My First Article"