Skip to content

Instantly share code, notes, and snippets.

@jeffmarshall
Created September 17, 2015 18:02
Show Gist options
  • Save jeffmarshall/b48409b6318a17a6c634 to your computer and use it in GitHub Desktop.
Save jeffmarshall/b48409b6318a17a6c634 to your computer and use it in GitHub Desktop.
{"mapping":{"actionLink":"item['data','url']","profileImage":"item[\"data\",\"thumbnail\"]","descriptionTitle":"item[\"data\",\"name\"]","descriptionBody":"item[\"data\",\"domain\"]","footerCaption":"item[\"data\",\"subreddit\"]"},"title":"Raddit","type":"stream","template":"Temp_4","endpoint":"https://www.reddit.com/.json","pathToMainArray":"api['data','children']","createdAt":"2015-09-17T18:02:15.390Z","source":"TITLE = \"Raddit\",\r\nICON_URL = \"\",\r\nSUMMARY = \"\",\r\nCREATED_BY = \"Jeff Marshall\",\r\nGITHUB_ID = \"\",\r\nCREDITS = \"\",\r\nSETTINGS_TYPE = \"NONE\",\r\nPREVIEW_IMG= \"\",\r\nPREVIEW_TITLE= \"Some Template Title\"\r\n\r\n\r\nLOAD {\r\n\r\n var url = \"https://www.reddit.com/.json\"\r\n\r\n var location = APP.location\r\n\r\n var actualURL = url.replace(\"{lat}\",location.latitude).replace(\"{lng}\",location.longitude)\r\n\r\n var api = get(actualURL)\r\n\r\n return api['data','children'].loop {\r\n item in\r\n\r\n return [\r\n [\r\n \"actions\":[\r\n [\r\n \"icon\":\"source-icon\",\r\n \"function\":APP.webview(item['data','url'])\r\n ]\r\n ]\r\n ],\r\n [\r\n \"profile\":[\r\n \"type\": \"large\",\r\n \"image\": item[\"data\",\"thumbnail\"]\r\n ]\r\n ],\r\n [\r\n \"description\":[\r\n \"type\": \"medium\",\r\n \"title\": item[\"data\",\"name\"],\r\n \"body\": item[\"data\",\"name\"]\r\n ]\r\n ],\r\n [\r\n \"footer\":[\r\n \"align\": \"right\"\r\n \"caption\": item[\"data\",\"subreddit\"]\r\n ]\r\n ]\r\n ]\r\n }\r\n\r\n}\r\n"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment