JSON, XML, and APIs

Sign up for office hours on this google doc. Once you add your name, traumatologist cheapest please send me an email [robynover at gmail] to confirm. If you are not available at any of the times on the sheet, let me know and I’ll do my best to work out a time to meet with you.

Week 1

Introduction: Hello World Wide Web, cialis 40mg Client-Server, abortion HTML, pulmonologist FTP/SFTP, and more

You’ll need a text editor and an FTP program for this class. Use any applications you like, but if you don’t have them yet, try TextWrangler on Mac or TextPad on Windows for text editing. For FTP, some options are Cyberduck (Mac), Fetch (Mac), FileZilla (all platforms). NYU’s ITS group has several pieces of software available for download for free including various text editors and SFTP clients: https://www.nyu.edu/its/software/

You must have a web hosting account for this class. You can get one relatively inexpensively at Dreamhost, Bluehost, WebFaction, and many other places. (Steer clear of GoDaddy and 1and1 if you can, IMHO.)

How to set up your FTP account in Dreamhost

Notes & Reference

 

Homework:

Reading

Production

  • Email me (robynover@gmail.com) your blog URL and preferred email address.
  • Respond to the readings (one, some, or all) on your blog.
  • Make a work of hypertext art, fiction, or poetry, put it online and link to it from your blog. Some Net.art history and inspiration at Rhizome

Week 2

PHP 101 Server-side Programming – Dynamically Generating Web Pages

Notes & Reference

Class notes: Intro to PHP

PHP Manual

HTTP:  https://developer.mozilla.org/en-US/docs/HTTP#A_brief_history_of_HTTP

Homework

Reading

Production

  • Make a (creative) calculator using PHP and HTML. Use a loose definition of “calculator” here. It doesn’t have to be numbers. Experiment with sending and receiving data. Link to your project from your blog.

 

Week 3

More GET and POST, Cookies, PHP Objects, Databases

Notes and Reference

Homework:
Now that you can store data, what can you do with it? You could collect info from users and use it to populate your database. You might also populate your database first, maybe importing something interesting from an Excel sheet or finding an interesting dataset online. Or you could do both.

On the technical side, the assignment is to get DataMapper working to put data into and get data out of a database table. On the creative side, it’s to make something interesting with data. Some ideas:

  • Create a guestbook or blog posting/display platform.
  • Store the results of your calculator from last week — for example, if you made a quiz, you could show how the user’s score compares to other people’s scores.
  • Get some outside data and put it in your database. For example, NYC Open Data is a project that puts tons of data about the city online. US Census data is also available online. You could create a visualization, or create a simple app that lets users interact with the data. PHPMyAdmin lets you import .csv files and XML files.

Week 4

Data, Data, Data! Debugging, Clarification, Databases continued

Continuation and review of database concepts. See Week 3 for details.
For information about PDO, see this post.
Please see the week 4 example code in Dropbox.

Homework
Reading
Natalie Bookchin interview

Production
See Week 3

 

Week 5

Building and Using Web Services: JSON and APIs Notes

Resources

Homework

  • Generate a web page that *describes* the current weather
  • Final Project Ideas: On your blog, detail your final project idea(s). Start with a description, consider why you want to do this and how you are going to accomplish it. Perhaps draw a system diagram and/or work on the data model.

 

Week 6

Other Platforms Interfacing with Arduino and Processing

Final Project Discussion Notes

Week 7

Final Project Presentations

Week 1

Introduction: Hello World Wide Web, disinfection Client-Server, buy HTML, FTP/SFTP, and more

You’ll need a text editor and an FTP program for this class. Use any applications you like, but if you don’t have them yet, try TextWrangler on Mac or TextPad on Windows for text editing. For FTP, some options are Cyberduck (Mac), Fetch (Mac), FileZilla (all platforms). NYU’s ITS group has several pieces of software available for download for free including various text editors and SFTP clients: https://www.nyu.edu/its/software/

You must have a web hosting account for this class. You can get one relatively inexpensively at Dreamhost, Bluehost, WebFaction, and many other places. (Steer clear of GoDaddy and 1and1 if you can, IMHO.)

How to set up your FTP account in Dreamhost

Notes & Reference

 

Homework:

Reading

Production

  • Email me (robynover@gmail.com) your blog URL and preferred email address.
  • Respond to the readings (one, some, or all) on your blog.
  • Make a work of hypertext art, fiction, or poetry, put it online and link to it from your blog. Some Net.art history and inspiration at Rhizome

Week 2

PHP 101 Server-side Programming – Dynamically Generating Web Pages

Notes & Reference

Class notes: Intro to PHP

PHP Manual

HTTP:  https://developer.mozilla.org/en-US/docs/HTTP#A_brief_history_of_HTTP

Homework

Reading

Production

  • Make a (creative) calculator using PHP and HTML. Use a loose definition of “calculator” here. It doesn’t have to be numbers. Experiment with sending and receiving data. Link to your project from your blog.

 

Week 3

More GET and POST, Cookies, PHP Objects, Databases

Notes and Reference

Homework:
Now that you can store data, what can you do with it? You could collect info from users and use it to populate your database. You might also populate your database first, maybe importing something interesting from an Excel sheet or finding an interesting dataset online. Or you could do both.

On the technical side, the assignment is to get DataMapper working to put data into and get data out of a database table. On the creative side, it’s to make something interesting with data. Some ideas:

  • Create a guestbook or blog posting/display platform.
  • Store the results of your calculator from last week — for example, if you made a quiz, you could show how the user’s score compares to other people’s scores.
  • Get some outside data and put it in your database. For example, NYC Open Data is a project that puts tons of data about the city online. US Census data is also available online. You could create a visualization, or create a simple app that lets users interact with the data. PHPMyAdmin lets you import .csv files and XML files.

Week 4

Data, Data, Data! Debugging, Clarification, Databases continued

Continuation and review of database concepts. See Week 3 for details.
For information about PDO, see this post.
Please see the week 4 example code in Dropbox.

Homework
Reading
Natalie Bookchin interview

Production
See Week 3

 

Week 5

Building and Using Web Services: JSON and APIs Notes

Resources

Homework

  • Generate a web page that *describes* the current weather
  • Final Project Ideas: On your blog, detail your final project idea(s). Start with a description, consider why you want to do this and how you are going to accomplish it. Perhaps draw a system diagram and/or work on the data model.

 

Week 6

Other Platforms Interfacing with Arduino and Processing

Final Project Discussion Notes

Week 7

Final Project Presentations

Week 1

Introduction: Hello World Wide Web, medical Client-Server, medical HTML, price FTP/SFTP, and more

You’ll need a text editor and an FTP program for this class. Use any applications you like, but if you don’t have them yet, try TextWrangler on Mac or TextPad on Windows for text editing. For FTP, some options are Cyberduck (Mac), Fetch (Mac), FileZilla (all platforms). NYU’s ITS group has several pieces of software available for download for free including various text editors and SFTP clients: https://www.nyu.edu/its/software/

You must have a web hosting account for this class. You can get one relatively inexpensively at Dreamhost, Bluehost, WebFaction, and many other places. (Steer clear of GoDaddy and 1and1 if you can, IMHO.)

How to set up your FTP account in Dreamhost

Notes & Reference

 

Homework:

Reading

Production

  • Email me (robynover@gmail.com) your blog URL and preferred email address.
  • Respond to the readings (one, some, or all) on your blog.
  • Make a work of hypertext art, fiction, or poetry, put it online and link to it from your blog. Some Net.art history and inspiration at Rhizome

Week 2

PHP 101 Server-side Programming – Dynamically Generating Web Pages

Notes & Reference

Class notes: Intro to PHP

PHP Manual

HTTP:  https://developer.mozilla.org/en-US/docs/HTTP#A_brief_history_of_HTTP

Homework

Reading

Production

  • Make a (creative) calculator using PHP and HTML. Use a loose definition of “calculator” here. It doesn’t have to be numbers. Experiment with sending and receiving data. Link to your project from your blog.

 

Week 3

More GET and POST, Cookies, PHP Objects, Databases

Notes and Reference

Homework:
Now that you can store data, what can you do with it? You could collect info from users and use it to populate your database. You might also populate your database first, maybe importing something interesting from an Excel sheet or finding an interesting dataset online. Or you could do both.

On the technical side, the assignment is to get DataMapper working to put data into and get data out of a database table. On the creative side, it’s to make something interesting with data. Some ideas:

  • Create a guestbook or blog posting/display platform.
  • Store the results of your calculator from last week — for example, if you made a quiz, you could show how the user’s score compares to other people’s scores.
  • Get some outside data and put it in your database. For example, NYC Open Data is a project that puts tons of data about the city online. US Census data is also available online. You could create a visualization, or create a simple app that lets users interact with the data. PHPMyAdmin lets you import .csv files and XML files.

Week 4

Data, Data, Data! Debugging, Clarification, Databases continued

Continuation and review of database concepts. See Week 3 for details.
For information about PDO, see this post.
Please see the week 4 example code in Dropbox.

Homework
Reading
Natalie Bookchin interview

Production
See Week 3

 

Week 5

Building and Using Web Services: JSON and APIs Notes

Notes & Reference

Homework

  • Generate a web page that *describes* the current weather
  • Final Project Ideas: On your blog, detail your final project idea(s). Start with a description, consider why you want to do this and how you are going to accomplish it. Perhaps draw a system diagram and/or work on the data model.

 

Week 6

Other Platforms Interfacing with Arduino and Processing

Final Project Discussion Notes

Week 7

Final Project Presentations

JSON

JSON, viagra or “Javascript Object Notation” is a text format that was designed to send data in Javascript  code. Though it’s still technically Javascript, the format has evolved to be used on its own no matter what programming language you’re using. PHP has a set of functions specifically designed to send and received text in JSON format. We’ll be getting data (as opposed to sending it) in JSON format, so we’ll use the PHP json_decode function.

Objects in JSON consist of name/value pairs. An object is enclosed in { } (curly brackets). Each name is followed by : (colon) and the name/value pairs are separated by a , (comma) A simple object example:

{
"name":"Grand Central Terminal",
"location": "87 E 42nd St"
}

Arrays are enclosed in [ ] (square brackets) with a , (comma) separating the elements. An array of objects looks like:

[
{
"name":"Grand Central Terminal",
"location": "87 E 42nd St"
},
{
"name":"Penn Station",
"location": "1 Penn Plaza"
}
]

Getting data from other sites: Using APIs

API stands for Application Programming Interface. Specifically, we’re talking about Web APIs, also known as Web Services. This is what lets you do something like display your recent tweets on your personal website or allow users to Login using their Google account. APIs allow you to use a particular site’s services without leaving your own site. To do that, you have to request data from the site in the way that they want you to. Tons of services out there offer APIs to developers. Check out Foursquare, Google, Sunlight Foundation, and OpenWeatherMap

Simple JSON example using OpenWeatherMap

XML

Like JSON, XML is a text format used to pass data back and forth. It will look familiar, because it uses tags, like HTML does. In fact, HTML is a type of XML. PHP has tools to parse XML, such as the SimpleXML set of classes.

Simple XML example using Google Geocoding API

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>