-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfetch_projects.dart
102 lines (96 loc) · 23.6 KB
/
fetch_projects.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import "dart:convert";
import 'dart:io';
import 'dart:async';
final JSON_URL = "https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values?alt=json";
final YAML_PATH = "_data/projects.yml";
//var JSONP_URL = "https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values?alt=json-in-script&callback=pfunc";
//var DEBUG_DATA = r"""
//{"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gsx":"http://schemas.google.com/spreadsheets/2006/extended","id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"List 1"},"link":[{"rel":"alternate","type":"text/html","href":"https://spreadsheets.google.com/pub?key\u003d0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values"},{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values?alt\u003djson-in-script"}],"author":[{"name":{"$t":"filip.hracek"},"email":{"$t":"[email protected]"}}],"openSearch$totalResults":{"$t":"12"},"openSearch$startIndex":{"$t":"1"},"entry":[{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cokwr"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"WorldProblems"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 8, category: App, suggestedtechnologies: Go (App Engine), problemdescription: Create a simple web app that displays a random #firstworldproblem and a random third world problem, side by side. Reloading the page displays another pair., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cokwr"}],"gsx$projectname":{"$t":"WorldProblems"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"8"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":""},"gsx$suggestedtechnologies":{"$t":"Go (App Engine)"},"gsx$problemdescription":{"$t":"Create a simple web app that displays a random #firstworldproblem and a random third world problem, side by side. Reloading the page displays another pair."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cpzh4"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"WorldProblems.Neat"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: WorldProblems, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 16, category: App, tags: UX, suggestedtechnologies: Dart, Polymer, problemdescription: Build upon the 'static' WorldProblems app so that it looks great on all devices and in addition to reloading, user can get the next pair by ajax., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cpzh4"}],"gsx$projectname":{"$t":"WorldProblems.Neat"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"WorldProblems"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"16"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":"Dart, Polymer"},"gsx$problemdescription":{"$t":"Build upon the 'static' WorldProblems app so that it looks great on all devices and in addition to reloading, user can get the next pair by ajax."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cre1l"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"CustomBillboard"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 8, category: App, tags: UX, suggestedtechnologies: CSS with as little JS/Dart as possible, problemdescription: Find a photo of a billboard by the road, display it on a web page and allow the user to modify its contents (write onto the billboard). Make the result as realistic-looking as possible., hints: CSS 3D transforms, ContentEditable, http://www.google.com/fonts, dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cre1l"}],"gsx$projectname":{"$t":"CustomBillboard"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"8"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":"CSS with as little JS/Dart as possible"},"gsx$problemdescription":{"$t":"Find a photo of a billboard by the road, display it on a web page and allow the user to modify its contents (write onto the billboard). Make the result as realistic-looking as possible."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":"CSS 3D transforms, ContentEditable, http://www.google.com/fonts"},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/chk2m"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"SumoCars"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Medium, estimatedperson-hours: 64, category: Game, tags: AI, suggestedtechnologies: Dart, StageXL, problemdescription: Recreate this game: http://www.kongregate.com/games/filiphracek/abel-cars. (It is itself a recreation of an old Amiga game whose name I have forgotten.) Allow for multiplayer., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/chk2m"}],"gsx$projectname":{"$t":"SumoCars"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Medium"},"gsx$estimatedperson-hours":{"$t":"64"},"gsx$category":{"$t":"Game"},"gsx$tags":{"$t":"AI"},"gsx$suggestedtechnologies":{"$t":"Dart, StageXL"},"gsx$problemdescription":{"$t":"Recreate this game: http://www.kongregate.com/games/filiphracek/abel-cars. (It is itself a recreation of an old Amiga game whose name I have forgotten.) Allow for multiplayer."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/ciyn3"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"SumoCars.AITournament"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: SumoCars, pre-requisites: None, difficulty: Medium, estimatedperson-hours: 32, category: Game, tags: AI, suggestedtechnologies: Dart, problemdescription: Make it possible to plug into the SumoCars app a 3rd party Artificial Intelligence. On each AI update, the AI receives some info about its car's position and surroundings, and needs to output its steering. The response from the AI is asynchronous and the speed of decision matters., hints: Dart's URL isolates, dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/ciyn3"}],"gsx$projectname":{"$t":"SumoCars.AITournament"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"SumoCars"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Medium"},"gsx$estimatedperson-hours":{"$t":"32"},"gsx$category":{"$t":"Game"},"gsx$tags":{"$t":"AI"},"gsx$suggestedtechnologies":{"$t":"Dart"},"gsx$problemdescription":{"$t":"Make it possible to plug into the SumoCars app a 3rd party Artificial Intelligence. On each AI update, the AI receives some info about its car's position and surroundings, and needs to output its steering. The response from the AI is asynchronous and the speed of decision matters."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":"Dart's URL isolates"},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/ckd7g"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"SpreadsheetCMS"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 16, category: App, problemdescription: Create a microsite platform that gets its content from a Google Spreadsheet., hints: https://developers.google.com/gdata/samples/spreadsheet_sample, dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/ckd7g"}],"gsx$projectname":{"$t":"SpreadsheetCMS"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"16"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":""},"gsx$suggestedtechnologies":{"$t":""},"gsx$problemdescription":{"$t":"Create a microsite platform that gets its content from a Google Spreadsheet."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":"https://developers.google.com/gdata/samples/spreadsheet_sample"},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/clrrx"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"SpreadsheetCMS.Gorgeous"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Medium, estimatedperson-hours: 16, category: App, tags: UX, problemdescription: Build upon the SpreadsheetCMS to make the resulting microsite beautiful while also being responsive and fast to load., hints: https://developers.google.com/speed/pagespeed/insights/, http://www.google.com/fonts, dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/clrrx"}],"gsx$projectname":{"$t":"SpreadsheetCMS.Gorgeous"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Medium"},"gsx$estimatedperson-hours":{"$t":"16"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":""},"gsx$problemdescription":{"$t":"Build upon the SpreadsheetCMS to make the resulting microsite beautiful while also being responsive and fast to load."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":"https://developers.google.com/speed/pagespeed/insights/, http://www.google.com/fonts"},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cyevm"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"CountdownClock"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 8, category: App, tags: UX, problemdescription: Create a customizable clock dashboard that counts down till end of the working day, end of the quarter, end of the year. The goal is to give the user an overview of where in the day/quarter/year they are and how much time they have remaining., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cyevm"}],"gsx$projectname":{"$t":"CountdownClock"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"8"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":""},"gsx$problemdescription":{"$t":"Create a customizable clock dashboard that counts down till end of the working day, end of the quarter, end of the year. The goal is to give the user an overview of where in the day/quarter/year they are and how much time they have remaining."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cztg3"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"GameOfLife"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Easy, estimatedperson-hours: 8, category: App, problemdescription: Implement Conway's Game of Life., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cztg3"}],"gsx$projectname":{"$t":"GameOfLife"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Easy"},"gsx$estimatedperson-hours":{"$t":"8"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":""},"gsx$suggestedtechnologies":{"$t":""},"gsx$problemdescription":{"$t":"Implement Conway's Game of Life."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/d180g"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"Hyde"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Hard, estimatedperson-hours: 128, category: Tool, suggestedtechnologies: Not Ruby (because Jekyll is in Ruby), problemdescription: Create a tool similar to Jekyll., dateadded: 10.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/d180g"}],"gsx$projectname":{"$t":"Hyde"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Hard"},"gsx$estimatedperson-hours":{"$t":"128"},"gsx$category":{"$t":"Tool"},"gsx$tags":{"$t":""},"gsx$suggestedtechnologies":{"$t":"Not Ruby (because Jekyll is in Ruby)"},"gsx$problemdescription":{"$t":"Create a tool similar to Jekyll."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"10.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/d2mkx"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"GarageAppDesign"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: None, pre-requisites: None, difficulty: Medium, estimatedperson-hours: 8, category: App, tags: UX, suggestedtechnologies: Pen \u0026 Paper, problemdescription: Using the UX concept of personas and a series of (pen \u0026 paper) mockups, design an app that would be actually useful for GDG Garage attendees. Make it as simple as humanly possible., dateadded: 11.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/d2mkx"}],"gsx$projectname":{"$t":"GarageAppDesign"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"None"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Medium"},"gsx$estimatedperson-hours":{"$t":"8"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":"Pen \u0026 Paper"},"gsx$problemdescription":{"$t":"Using the UX concept of personas and a series of (pen \u0026 paper) mockups, design an app that would be actually useful for GDG Garage attendees. Make it as simple as humanly possible."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":""},"gsx$dateadded":{"$t":"11.12.2013"}},{"id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cssly"},"updated":{"$t":"2013-12-11T12:27:39.985Z"},"category":[{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"GarageAppDesign.Implementation"},"content":{"type":"text","$t":"author: Filip Hracek, homegdggarage: Smichov, pre-requisiteprojectname: GarageAppDesign, pre-requisites: None, difficulty: Hard, estimatedperson-hours: 64, category: App, tags: UX, suggestedtechnologies: Android SDK, problemdescription: Implement the app designed in GarageAppDesign. Focus on the UX., hints: http://developer.android.com/design/index.html, dateadded: 11.12.2013"},"link":[{"rel":"self","type":"application/atom+xml","href":"https://spreadsheets.google.com/feeds/list/0AjP0HrbVsp3KdEdiUWlDakpaYUZRcTBNZ2cxaTlZalE/od6/public/values/cssly"}],"gsx$projectname":{"$t":"GarageAppDesign.Implementation"},"gsx$author":{"$t":"Filip Hracek"},"gsx$homegdggarage":{"$t":"Smichov"},"gsx$pre-requisiteprojectname":{"$t":"GarageAppDesign"},"gsx$pre-requisites":{"$t":"None"},"gsx$difficulty":{"$t":"Hard"},"gsx$estimatedperson-hours":{"$t":"64"},"gsx$category":{"$t":"App"},"gsx$tags":{"$t":"UX"},"gsx$suggestedtechnologies":{"$t":"Android SDK"},"gsx$problemdescription":{"$t":"Implement the app designed in GarageAppDesign. Focus on the UX."},"gsx$urlmoreinfodesigndocetc.":{"$t":""},"gsx$hints":{"$t":"http://developer.android.com/design/index.html"},"gsx$dateadded":{"$t":"11.12.2013"}}]}}
//""";
main() {
List<Project> projects = new List<Project>();
print("Fetching...");
_fetch(JSON_URL).then((json) {
print("Parsing...");
Map data = JSON.decode(json);
for (Map entry in data["feed"]["entry"]) {
projects.add(new Project.fromSpreadsheetJsonMap(entry));
}
print("Done.");
print("Opening file $YAML_PATH for writing...");
return new File(YAML_PATH).open(mode: FileMode.WRITE);
}).then((RandomAccessFile file) {
print("Writing to .yaml file...");
projects.forEach((project) {
file.writeStringSync("- ${JSON.encode(project.toMap())}\n");
});
file.close();
print("Done.");
});
}
class Project {
String projectName;
String author;
String homeGdgGarage;
String prerequisiteProjectName;
String prerequisites;
String difficulty;
String estimatedPersonHours; // yep, String -- we don't know what craziness people will input here
String category;
String tags;
String suggestedTechnologies;
String problemDescription;
String url;
String hints;
String dateAdded;
/**
* Takes
*/
Project.fromSpreadsheetJsonMap(Map entry) {
projectName = entry[r"gsx$projectname"][r"$t"];
author = entry[r"gsx$author"][r"$t"];
homeGdgGarage = entry[r"gsx$homegdggarage"][r"$t"];
prerequisiteProjectName = entry[r"gsx$pre-requisiteprojectname"][r"$t"];
prerequisites = entry[r"gsx$pre-requisites"][r"$t"];
difficulty = entry[r"gsx$difficulty"][r"$t"];
estimatedPersonHours = entry[r"gsx$estimatedperson-hours"][r"$t"];
category = entry[r"gsx$category"][r"$t"];
tags = entry[r"gsx$tags"][r"$t"];
suggestedTechnologies = entry[r"gsx$suggestedtechnologies"][r"$t"];
problemDescription = entry[r"gsx$problemdescription"][r"$t"];
url = entry[r"gsx$urlmoreinfodesigndocetc."][r"$t"];
hints = entry[r"gsx$hints"][r"$t"];
dateAdded = entry[r"gsx$dateadded"][r"$t"];
}
toString() => "Project<$projectName>";
toMap() => {
"projectName": projectName,
"author": author,
"homeGdgGarage": homeGdgGarage,
"prerequisiteProjectName": prerequisiteProjectName,
"prerequisites": prerequisites,
"difficulty": difficulty,
"estimatedPersonHours": estimatedPersonHours,
"category": category,
"tags": tags,
"suggestedTechnologies": suggestedTechnologies,
"problemDescription": problemDescription,
"url": url,
"hints": hints,
"dateAdded": dateAdded
};
}
Future<String> _fetch(String url) {
Completer completer = new Completer();
HttpClient client = new HttpClient();
client.getUrl(Uri.parse(url))
.then((HttpClientRequest request) {
// Prepare the request then call close on it to send it.
return request.close();
})
.then((HttpClientResponse response) {
// Process the response.
response.transform(const Utf8Decoder()).join().then(completer.complete);
});
return completer.future;
}