edit-task
Home
Up
Delete
Task Name:
Task Description:
] SRC=stack overflow ? - calls to , process results
TaskGroup ID:
Start Date:
Start Time:
Duration:
Priority:
Status:
To Do
Completed
In Process
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">example - facebook</h1> <h2>[previously]</h2> <ol> <li>] example code - <a href="http://stackoverflow.com/questions/11826384/calling-a-json-api-with-node-js" target="_blank">using facebook graph api</a> - SRC=so question</li> </ol> <h2>[currently]</h2> <ol> <li>] </li> </ol> <h2>[next]</h2> <ol> <li>]</li> </ol> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #1e7c70;">call render results: fbResponse<br />TEMPLATE p=results.picture.url</span></pre> <p>my subset</p> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #1e7c70;">var url = 'http://graph.facebook.com/517267866/?fields=picture';</span></pre> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #1e7c70;">http.get(url, function(res) {<br /> var body = '';</span></pre> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #1e7c70;"> res.on('data', function(chunk) {<br /> body += chunk;<br /> });</span></pre> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #1e7c70;"> res.on('end', function() {<br /> var fbResponse = JSON.parse(body)<br /> console.log("Got response: ", fbResponse.picture);<br /> });<br />}).on('error', function(e) {<br /> console.log("Got error: ", e);<br />});</span></pre> <p> </p>