Javascript multiple drop down box - javascript

Is there a way to get a multiple drop down field from a list of arrays without having to hardcode the information into the HTML? So that by selecting each category the relevant subcategory will drop down.
The list looks something like this:
var listData = [
{
"title": "Meeting Room",
"category": "Forms",
"url": "https://www.google.co.uk/"
},
{
"title": "Book a Car",
"category": "Forms",
"url": "https://www.google.co.uk/"
},
{
"title": "Stationery",
"category": "Forms",
"url": "https://www.google.co.uk/"
},
{
"title": "Hospitality",
"category": "Forms",
"url": "https://www.google.co.uk/"
},
{
"title": "Communications",
"category": "News",
"url": "https://blogs.office.com/"
},
{
"title": "Industries",
"category": "News",
"url": "https://blogs.office.com/"
},
{
"title": "Policy",
"category": "News",
"url": "https://blogs.office.com/"
},
{
"title": "Get started",
"category": "Information",
"url": "https://support.office.com/"
},
{
"title": "What do you need",
"category": "Useful Information",
"url": "https://support.office.com/"
},
{
"title": "Accessibility features",
"category": "Useful Information",
"url": "https://support.office.com/"
},
{
"title": "Videos",
"category": "Useful Information",
"url": "https://support.office.com/"
}
]

The following code does the work. It's vanilla JS.
<!DOCTYPE html>
<html>
<head>
<title>Dynamic Form</title>
</head>
<body>
<select id="categories" onchange="changeCategory(event)"> </select>
<select id="title"> </select>
<select id="url"> </select>
<script>
var listData = [{
"title": "Meeting Room"
, "category": "Forms"
, "url": "https://www.google.co.uk/"
}, {
"title": "Book a Car"
, "category": "Forms"
, "url": "https://www.google.co.uk/"
}, {
"title": "Stationery"
, "category": "Forms"
, "url": "https://www.google.co.uk/"
}, {
"title": "Hospitality"
, "category": "Forms"
, "url": "https://www.google.co.uk/"
}, {
"title": "Communications"
, "category": "News"
, "url": "https://blogs.office.com/"
}, {
"title": "Industries"
, "category": "News"
, "url": "https://blogs.office.com/"
}, {
"title": "Policy"
, "category": "News"
, "url": "https://blogs.office.com/"
}, {
"title": "Get started"
, "category": "Information"
, "url": "https://support.office.com/"
}, {
"title": "What do you need"
, "category": "Useful Information"
, "url": "https://support.office.com/"
}, {
"title": "Accessibility features"
, "category": "Useful Information"
, "url": "https://support.office.com/"
}, {
"title": "Videos"
, "category": "Useful Information"
, "url": "https://support.office.com/"
}];
function removeOptions(selectbox) {
var i;
for (i = selectbox.options.length - 1; i >= 0; i--) {
selectbox.remove(i);
}
}
function changeCategory(event) {
removeOptions(document.getElementById('title'))
removeOptions(document.getElementById('url'))
mySelect1 = document.getElementById('title')
mySelect2 = document.getElementById('url');
listData.forEach(function (item, index) {
if (item.category == event.target.value) {
mySelect1.options[mySelect1.options.length] = new Option(item.title, item.title);
mySelect2.options[mySelect2.options.length] = new Option(item.url, item.url);
}
});
}
Array.prototype.contains = function (obj) {
var i = this.length;
while (i--) {
if (this[i] == obj) {
return true;
}
}
return false;
}
var mySelect = document.getElementById('categories');
var categories = new Array;
listData.forEach(function (item, index) {
if (!categories.contains(item.category)) {
mySelect.options[mySelect.options.length] = new Option(item.category, item.category);
categories.push(item.category);
}
});
</script>
</body>
</html>

Related

Looping through an object not giving me other languages

I have three JSON statements below that I have turned into a JavaScript object. I want to print out the actor, verb and object for each of these statements. I'm having trouble with the object.definition.name because sometimes it will appear in other languages. Because of this and the way I have it coded now, it gives me "undefined" for the second statement because the second statement is fr-FR and not en-US. How can I modify the object part of my loop so it gives me an object no matter what language it is?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Get Statements 1 demo</title>
<script src="xapiwrapper.min.js"></script>
</head>
<body>
<p id='demo'></p>
<script>
var obj1 =
{
"statements": [{
"verb": {
"id": "http://adlnet.gov/expapi/verbs/initialized",
"display": {
"en-US": "initialized"
}
},
"version": "1.0.0",
"timestamp": "2017-05-25T13:01:49.439248+00:00",
"object": {
"definition": {
"extensions": {
"http://example.com": 12
},
"name": {
"en-US": "Change management app"
}
},
"id": "https://www.avimegiddo.com/wp-admin/admin-ajax.php?action=h5p_embed&id=12",
"objectType": "Activity"
},
"actor": {
"mbox": "mailto:john.doe#abc.com",
"name": "John Doe",
"objectType": "Agent"
},
"stored": "2017-05-25T13:01:49.439248+00:00",
"authority": {
"mbox": "mailto:tom.creighton.ctr#adlnet.gov",
"name": "tom",
"objectType": "Agent"
},
"id": "2b03bcd0-11bd-4b43-a256-7e7c8cb259fc"
},
{
"verb": {
"id": "http://adlnet.gov/expapi/verbs/attempted",
"display": {
"en-US": "attempted"
}
},
"version": "1.0.0",
"timestamp": "2017-05-25T12:54:52.184309+00:00",
"object": {
"definition": {
"extensions": {
"http://h5p.org/x-api/h5p-local-content-id": 12
},
"name": {
"fr-FR": "le livre"
}
},
"id": "https://www.avimegiddo.com/wp-admin/admin-ajax.php?action=h5p_embed&id=12",
"objectType": "Activity"
},
"actor": {
"mbox": "mailto:sally.smith#abc.com",
"name": "Sally Smith",
"objectType": "Agent"
},
"stored": "2017-05-25T12:54:52.184309+00:00",
"authority": {
"mbox": "mailto:megiddo#gmail.com",
"name": "avimegiddo",
"objectType": "Agent"
},
"context": {
"contextActivities": {
"category": [{
"id": "http://h5p.org/libraries/H5P.DragText-1.5",
"objectType": "Activity"
}],
"grouping": [{
"definition": {
"moreInfo": "https://www.avimegiddo.com/business-emails/",
"type": "http://activitystrea.ms/schema/1.0/page",
"name": {
"en": "How to write business emails: be formal and polite. ESL / EFL Practice Quizzes."
}
},
"id": "https://www.avimegiddo.com/business-emails/"
}]
}
},
"id": "83105145-a27c-4bec-bbb0-c1c9f9775930"
},
{
"verb": {
"id": "http://adlnet.gov/expapi/verbs/attempted",
"display": {
"en-US": "attempted"
}
},
"version": "1.0.0",
"timestamp": "2017-05-25T13:51:45.976631+00:00",
"object": {
"definition": {
"extensions": {
"http://h5p.org/x-api/h5p-local-content-id": 5,
"http://h5p.org/x-api/h5p-subContentId": "bb5c8621-1bcf-4cc7-b1b0-8af2950bffcd"
},
"name": {
"en-US": "Drag the words into the correct boxes\n"
}
},
"id": "https://www.avimegiddo.com/wp-admin/admin-ajax.php?action=h5p_embed&id=5?subContentId=bb5c8621-1bcf-4cc7-b1b0-8af2950bffcd",
"objectType": "Activity"
},
"actor": {
"mbox": "mailto:terry.phillips#abc.com",
"name": "Terry Phillips",
"objectType": "Agent"
},
"stored": "2017-05-25T13:51:45.976631+00:00",
"authority": {
"mbox": "mailto:megiddo#gmail.com",
"name": "avimegiddo",
"objectType": "Agent"
},
"context": {
"extensions": {
"http://id.tincanapi.com/extension/ending-point": 1
},
"contextActivities": {
"category": [{
"id": "http://h5p.org/libraries/H5P.DragText-1.5",
"objectType": "Activity"
}],
"parent": [{
"id": "https://www.avimegiddo.com/wp-admin/admin-ajax.php?action=h5p_embed&id=5",
"objectType": "Activity"
}],
"grouping": [{
"definition": {
"moreInfo": "https://www.avimegiddo.com/2017/04/21/business-emails-short-quizzes/",
"type": "http://activitystrea.ms/schema/1.0/page",
"name": {
"en": "Projects ~ Avi Megiddo"
}
},
"id": "https://www.avimegiddo.com/2017/04/21/business-emails-short-quizzes/"
}]
}
},
"id": "7b0582d3-c22d-4818-937e-cc0e5ffbbf18"
}
]
}
var actorVerbObject = "";
for (i=0; i<3; i++){
actorVerbObject += obj1.statements[i].actor.name + ", " + obj1.statements[i].verb.display['en-US'] + ", " + obj1.statements[i].object.definition.name['en-US'] + "<br />";
}
document.getElementById('demo').innerHTML = actorVerbObject;
</script>
</body>
</html>
Use Object.keys See this fiddle
var actorVerbObject = "";
for (i = 0; i < 3; i++) {
var displayLangs = Object.keys(obj1.statements[i].verb.display);
var definitionLangs = Object.keys(obj1.statements[i].object.definition.name);
actorVerbObject += obj1.statements[i].actor.name + ", " + obj1.statements[i].verb.display[displayLangs[0]] + ", " + obj1.statements[i].object.definition.name[definitionLangs[0]] + "<br />";
}

how to replace the value in an JSON array for a existing key?

In my application I have a ajax call and am getting the following response based on this am constructing the questions & answer section which I have included in the JSFiddle
var responseQuestions = {
"error": false,
"message": "Success",
"result": {
"Questions": [{
"Id": "131a",
"Text": "In what county do you live?",
"Answers": [{
"Id": "abc1",
"Text": "option1"
},
{
"Id": "abc2",
"Text": "option2"
},
{
"Id": "abc3",
"Text": "option3"
},
{
"Id": "abc4",
"Text": "option4"
},
{
"Id": "abc5",
"Text": "option5"
}
],
"SelectedAnswerId": null
},
{
"Id": "132a",
"Text": "Which zip code has ever been a part of your address?",
"Answers": [{
"Id": "def1",
"Text": "option1"
},
{
"Id": "def2",
"Text": "option2"
},
{
"Id": "def3",
"Text": "option3"
},
{
"Id": "def4",
"Text": "option4"
},
{
"Id": "def5",
"Text": "option5"
}
],
"SelectedAnswerId": null
},
{
"Id": "133a",
"Text": "What was the original amount of your most recent mortgage?",
"Answers": [{
"Id": "ghi1",
"Text": "option1"
},
{
"Id": "ghi2",
"Text": "option2"
},
{
"Id": "ghi3",
"Text": "option3"
},
{
"Id": "ghi4",
"Text": "option4"
},
{
"Id": "ghi5",
"Text": "option5"
}
],
"SelectedAnswerId": null
}
]
}
};
Required Format:
var responseQuestions = {
"error": false,
"message": "Success",
"result": {
"Questions": [{
"Id": "131a",
"Text": "In what county do you live?",
"Answers": [{
"Id": "abc1",
"Text": "option1"
},
{
"Id": "abc2",
"Text": "option2"
},
{
"Id": "abc3",
"Text": "option3"
},
{
"Id": "abc4",
"Text": "option4"
},
{
"Id": "abc5",
"Text": "option5"
}
],
**"SelectedAnswerId": "abc2"**
},
{
"Id": "132a",
"Text": "Which zip code has ever been a part of your address?",
"Answers": [{
"Id": "def1",
"Text": "option1"
},
{
"Id": "def2",
"Text": "option2"
},
{
"Id": "def3",
"Text": "option3"
},
{
"Id": "def4",
"Text": "option4"
},
{
"Id": "def5",
"Text": "option5"
}
],
**"SelectedAnswerId": "def1"**
},
{
"Id": "133a",
"Text": "What was the original amount of your most recent mortgage?",
"Answers": [{
"Id": "ghi1",
"Text": "option1"
},
{
"Id": "ghi2",
"Text": "option2"
},
{
"Id": "ghi3",
"Text": "option3"
},
{
"Id": "ghi4",
"Text": "option4"
},
{
"Id": "ghi5",
"Text": "option5"
}
],
**"SelectedAnswerId": "ghi2"**
}
]
}
};
Now I need to submit this answer with the same above mentioned format along the "SelectedAnswerId" value(in the above mentioned array "SelectedAnswerId" is null and now I have to include the original selected ans Id based on questions ).
I have tried to fetch all the selected ans id in a array and attached the same in jsfiddle but am unable to proceed on how to append this ans id in the existing array based on questions. How to achieve this ?
Try the following loops:
$('input[type="radio"]:checked').each(function() {
var questionId = $(this).closest('.radioGroup').prev().attr('id');//get the question id
var answerId = this.id;//get the answer id
$.each(responseQuestions.result.Questions, function(i, v) {//loop each question
if (v.Id == questionId) {
$.each(v.Answers, function(ind, val) {//loop each answer
if (val.Id == answerId) {
responseQuestions.result.Questions[i]['SelectedAnswerId'] = answerId;//save the answer
}
});
}
});
});
console.log(responseQuestions);
demo:https://jsfiddle.net/mj3gvd5e/1/
Note: you need to change your question id to remove or add the a to be consistent both in the page and in the json
You have to find index based on question id and then set answerid at specific index
var index = responseQuestions.result.Questions.findIndex(function(val){
return val.Id === yourQuestionid;
})
responseQuestions.result.Questions[index].SelectedAnswerId = youranswerID;
First of all you need to have your main question id and Ans id into same array as given fiddle by Madalin jsfiddle.net/6q9mct68
second you get this array, you can loop through your first array and replace the string by compairing Id,

How do I join multiple columns into one in footable?

I have a FooTable that gets a part number returned as 3 separate cells. I'd like to combine them into one cell but I'm unsure of how the formatter and parser work for FooTable. my table html is just an empty table, everything is handledin the javascript. How would I go about doing this?
$(document).ready(function() {
jQuery(function($){
$('.table').footable({
"expandFirst": false,
"columns": [
{ "name": "PartID", "title":"PartID", "visible":false },
{"formatter": function(value){
return //I'm thinking this is where the code would go to join the next 3 columns? in the format ##.###.##
}},
{ "name": "PartCategory", "title": "PC" },
{ "name": "PartNumber1", "title": "PN1" },
{ "name": "PartNumber2", "title": "PN2", },
{ "name": "PartName", "title": "Name", },
{ "name": "DescShort", "title": "Description", },
{ "name": "SupplierName", "title": "Supplier", },
{ "name": "SupplierPartNumber", "title": "Supplier Part #", }
],
"rows": $.getJSON("../dist/scripts/testGetParts.php")
});
});
});
You can simply add data-hide="all" to the first two columns of those three:
{ "name": "", "title": "", data-hide="all"},
{ "name": "", "title": "", data-hide="all"},
{ "name": "Part Info", "title": "Part Information" }
Merge those in php (which you are good at) and just show them in here as one col in your dataset and Voila.
The simpler version if you can change the dataset is to not add those columns at all.
Another option if you cannot/don't want to change your server side code is to get the data and change it js and then bind them to rows afterwards.
var rows = $.getJSON("../dist/scripts/testGetParts.php");
foreach(row in rows) {
//merge those cols here in the third one
}
And then:
jQuery(function($){
$('.table').footable({
"expandFirst": false,
"columns": [
{ "name": "PartID", "title":"PartID", "visible":false },
{ "name": "PartCategory", "title": "PC", data-hide="all" },
{ "name": "PartNumber1", "title": "PN1", data-hide="all"},
{ "name": "Part Info", "title": "Part information" },
{ "name": "PartName", "title": "Name", },
{ "name": "DescShort", "title": "Description", },
{ "name": "SupplierName", "title": "Supplier", },
{ "name": "SupplierPartNumber", "title": "Supplier Part #", }
],
"rows": rows
});
});
Not sure how you do it persay in footable, in kendo you would do it like so.
$(document).ready(function() {
jQuery(function($){
$('.table').footable({
"expandFirst": false,
"columns": [
{ "name": "PartID", "title":"PartID", "visible":false },
{ "title":"PartNumber", formatter: function(data){
return data.PartCategory +"."+ data.PartNumber1 +"." + PartNumber2;
}},
{ "name": "PartName", "title": "Name", },
{ "name": "DescShort", "title": "Description", },
{ "name": "SupplierName", "title": "Supplier", },
{ "name": "SupplierPartNumber", "title": "Supplier Part #", }
],
"rows": $.getJSON("../dist/scripts/testGetParts.php")
});
});
});

JSON calculate total number of particular Array object and result grouping

I have the following JSON data output from firebug console and I am trying to count the total number of the second item "Open" and group the result by Team. I am pulling the data from our SharePoint list.
"d":
{
"results":
[
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(53)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(53)",
"etag": ""18"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team A",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(54)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(54)",
"etag": ""97"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team B",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(82)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(82)",
"etag": ""65"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team B",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(97)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(97)",
"etag": ""18"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team C",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(99)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(99)",
"etag": ""8"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team E",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(106)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(106)",
"etag": ""44"",
"type": "SP.Data.TasksListItem"
},
"Team": "Team D",
"taskStatus": "Open"
},
I have used the following JavaScript and I am getting only a value that is not correct. I only get 3, which is not correct. It should be 300 or more. For the sake of brevity I am only posting an excerpt of my JSON data.
// JavaScript source code
$.ajax({
url: _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/GetByTitle('Teams')/Items?$filter=taskStatus eq 'Open'&$select=Team,taskStatus",
type: "GET",
dataType: "json",
async: "true",
headers: {
"accept": "application/json;odata=verbose",
},
success: function (data) {
var dataArray = [];
var countArray = [];
var results = data.d.results;
for (var i = 0; i < results.length; i++){
for (key in results[i]) {
if (results[i].hasOwnProperty(key)) {
countArray.push(results[i][key]);
}
}
}
for (var i = 0; i < results.length; i++){
var team = Object.keys(results[1]).length; //This is returning only the value of 3
console.log(team);
}
console.log(countArray);
},
error: function(err) {
alert(JSON.stringify(err));
}
});
Can you please assist in solving this?
I have revised the raw JSON data as requested to reflect what I get from the server.
The output of console.log(team) is always 3 because when you call Object.keys(results[1]).length you are just finding the number of properties (keys) in the first result object (from your sample JSON data).
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(53)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(53)",
"etag": "18",
"type": "SP.Data.TasksListItem"
},
"Team": "Team A",
"taskStatus": "Open"
}
A simple loop over the results can group them:
var results = data.d.results;
var openCount = results.length;
var groupedResults = {};
//Total number of open tasks
console.log(openCount);
for (var i = 0; i < openCount; i++) {
var team = results[i]["Team"]
if (!groupedResults[team]) {
groupedResults[team] = [];
}
groupedResults[team].push(results[i]);
}
//Open tasks grouped by team
console.log(groupedResults);
//Count of open tasks for "Team B"
console.log(groupedResults["Team B"].length);
See the code snippet below for a fully functional demo based using your sample data.
var data = {
"d":
{
"results":
[
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(53)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(53)",
"etag": "18",
"type": "SP.Data.TasksListItem"
},
"Team": "Team A",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(54)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(54)",
"etag": "97",
"type": "SP.Data.TasksListItem"
},
"Team": "Team B",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(82)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(82)",
"etag": "65",
"type": "SP.Data.TasksListItem"
},
"Team": "Team B",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(97)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(97)",
"etag": "18",
"type": "SP.Data.TasksListItem"
},
"Team": "Team C",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(99)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(99)",
"etag": "8",
"type": "SP.Data.TasksListItem"
},
"Team": "Team E",
"taskStatus": "Open"
},
{
"__metadata":
{
"id": "Web/Lists(guid'1234578785596655')/Items(106)",
"uri": "https://spteamsite.com/_api/web/lists/GetByTitle('Teams')/Items(106)",
"etag": "44",
"type": "SP.Data.TasksListItem"
},
"Team": "Team D",
"taskStatus": "Open"
}
]
}
};
function printResult(value) {
var d = document.createElement('div');
d.innerHTML = JSON.stringify(value);
document.body.appendChild(d);
console.log(value);
}
var results = data.d.results;
var openCount = results.length;
var groupedResults = {};
//Total number of open tasks
printResult("Open tasks for all teams: " + openCount);
for (var i = 0; i < openCount; i++) {
var team = results[i]["Team"]
if (!groupedResults[team]) {
groupedResults[team] = [];
}
groupedResults[team].push(results[i]);
}
//Open tasks grouped by team
printResult(groupedResults);
//Count of open tasks for "Team B"
printResult("Open tasks for Team B: " + groupedResults["Team B"].length);
div {
border: 1px solid black;
margin: 10px;
}
If I understand your question correctly you want to group by Team then get sum of open.
Using linq.js it is easy
var aggregatedObject = Enumerable.From(data).GroupBy("$.Team", null,function (key, g) {
return {
Team: key,
Open: g.Sum("$.Open")
}
}).ToArray();
Edited
var query = Enumerable.From(jsonObject)
.GroupBy(
"$.City",
null,
"{ City: $, Count: $$.Count() }").ToArray()

Facebook Open Graph not returning all results for Books.Read?

When using the Facebook Open Graph explorer, I run the following, to get a list of my books read.
/706685881/books.reads?limit=25&offset=0
This returns only 5 results, even though I have more books read than that, and I've explicitly requested up to 25 results. Following the paging link to the (theoretical) more results, shows a page with no more results.
here's my output of the query:
{
"data": [
{
"data": {
"book": {
"id": "452418224806835",
"url": "https://www.facebook.com/pages/Fantastic-Voyage/452418224806835",
"type": "books.book",
"title": "Fantastic Voyage"
}
},
"id": "10151871872740882"
},
{
"data": {
"book": {
"id": "106151566083577",
"url": "https://www.facebook.com/pages/The-Andromeda-Strain/106151566083577",
"type": "books.book",
"title": "The Andromeda Strain"
}
},
"id": "10151870390740882"
},
{
"data": {
"progress": [
{
"timestamp": 1388668020,
"percent_complete": 0
},
{
"timestamp": 1392949225,
"percent_complete": 100
}
],
"book": {
"id": "10150233066083545",
"url": "http://www.goodreads.com/book/show/10664113-a-dance-with-dragons",
"type": "good_reads:book",
"title": "A Dance with Dragons (A Song of Ice and Fire, #5)"
}
},
"id": "10151867499170882"
},
{
"data": {
"progress": [
{
"timestamp": 1391350736,
"percent_complete": 0
},
{
"timestamp": 1392569208,
"percent_complete": 100
}
],
"book": {
"id": "1390736374489290",
"url": "http://www.goodreads.com/book/show/18405477-city-of-the-sun",
"type": "good_reads:book",
"title": "City of the Sun"
}
},
"id": "10151860185710882"
},
{
"data": {
"book": {
"id": "526531387368738",
"url": "http://apps.facebook.com/bookscout/?currworkid=9000000000133742",
"type": "books.book",
"title": "Gates of Fire"
}
},
"id": "10151226827780882"
}
],
"paging": {
"next": "https://graph.facebook.com/706685881/books.reads?fields=data&limit=25&offset=25&__after_id=10151226827780882"
}
}
Anybody seeing what I am doing wrong?

Categories

Resources