-
Notifications
You must be signed in to change notification settings - Fork 18
Week 5 Notes
Read:
See the code examples
Don't forget to check out the new code in the repo this week.
Creating a JSON file
Part of the assignment this week is to publish some JSON data. You don't necessarily have to write the JSON from scratch. If you have data in a spreadsheet, you can convert it to JSON. In your spreadsheet program, export the file as CSV, open the CSV file in Sublime or other text editor, copy the contents, and paste it into this online CSV-to-JSON converter. Then click "Download" or just copy and paste the resulting JSON into a new file and save it with the file extension .json
.
If you prefer, you can write JSON in a text editor, or use the online JSON editing tool, JSON Editor Online.
Refer to the notes on JSON as a formatting guide.
Publishing JSON
Post your JSON to gist. Gist is a service run by github that lets you post code snippets online; you can log in with your github account. Paste your code, click "Create Public Gist", and you'll see that your code has a URL.
For example, here's the link to my gist with some json text: https://gist.github.com/robynitp/10153952
Paste the link to your Gist on Class JSON feeds.
#####JSON Tools
- Chrome extension for viewing JSON files in the browser: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en
Try out some of these APIs or find others on your own:
- OpenWeatherMap | Example
- Sunlight Foundation | Example
- NY Times | Example
- Instagram | Example
- Foursquare
- YouTube | jsfiddle example (uses jQuery)
- Google Maps | jsfiddle example
Also see NYC Open Data, where you can get NYC-related datasets, some downloadable and others available as URLs.