Jump to content

Archived

This topic is now archived and is closed to further replies.

BBKing

JSON Output

Recommended Posts

BBKing

Hi,

 

I hope i can explain the topic correctly, but I am trying to find out how to make output generated by the JSON-API usable/readable. Some of the output generated by the Json-APi is like expected but the part with the actual content (see code starting form pl-settings) is not what I expected form JSON output. I am afraid a filter or controller is needed to sanitise the pagelines content. 

Hopefully somebody can help me. Even an answer that  it's not possible to get the content of the pagelines DMS website would be helpful.

 

I need the clean content for a project on an Iphone (native Objective C app)

 

Thanks.

{
id: 1,
slug: "bbking",
name: "BBKing",
first_name: "",
last_name: "",
nickname: "BBKing",
url: "",
description: ""
},
comments: [ ],
attachments: [ ],
comment_count: 0,
comment_status: "open",
custom_fields: {
pl-settings: [
"a:2:{s:4:"live";a:9:{s:10:"custom-map";a:1:{s:8:"template";a:3:{i:0;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areauxyzci5";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"uxyzci5";s:7:"content";a:1:{i:0;a:6:{s:6:"object";s:10:"PLMasthead";s:5:"clone";s:7:"ueydv4r";s:3:"sid";s:8:"masthead";s:4:"span";s:1:"8";s:6:"offset";s:1:"0";s:6:"newrow";s:5:"false";}}}i:1;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areau0tde47";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"u0tde47";s:7:"content";a:2:{i:0;a:6:{s:6:"object";s:9:"PLNextBox";s:5:"clone";s:7:"u0r1nzn";s:3:"sid";s:10:"pl-nextbox";s:4:"span";s:1:"6";s:6:"offset";s:1:"0";s:6:"newrow";s:5:"false";}i:1;a:6:{s:6:"object";s:17:"PageLinesMediaBox";s:5:"clone";s:7:"ut3ye3v";s:3:"sid";s:8:"mediabox";s:4:"span";s:1:"4";s:6:"offset";s:1:"1";s:6:"newrow";s:5:"false";}}}i:2;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areauj13a4a";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"uj13a4a";s:7:"content";a:1:{i:0;a:6:{s:6:"object";s:10:"PLICallout";s:5:"clone";s:7:"um5nfjw";s:3:"sid";s:8:"icallout";s:4:"span";s:2:"10";s:6:"offset";s:1:"1";s:6:"newrow";s:5:"false";}}}}}s:7:"uio3h1v";a:7:{s:11:"pl_area_pad";s:3:"0px";s:14:"pl_area_height";s:3:"325";s:16:"pl_area_parallax";s:11:"pl-parallax";s:18:"pl_area_background";s:49:"[pl_site_url]/wp-content/uploads/2014/05/Band.jpg";s:28:"pl_area_background_attach_id";s:2:"44";s:14:"pl_area_repeat";s:1:"0";s:20:"pl_area_color_enable";s:1:"0";}s:7:"uv7hznf";a:11:{s:18:"pl_standard_styles";s:15:"color: #de1f42;";s:24:"pagelines_masthead_title";s:10:"Onze Bands";s:26:"pagelines_masthead_tagline";s:46:"Guilty records is op zoek naar vergeten muziek";s:22:"masthead_button_link_1";s:21:"www.teamtreehouse.com";s:22:"masthead_button_text_1";s:10:"Meer weten";s:24:"masthead_button_target_1";s:1:"0";s:23:"masthead_button_theme_1";s:11:"btn-success";s:22:"masthead_button_link_2";s:9:"www.nu.nl";s:22:"masthead_button_text_2";s:11:"Meld je aan";s:24:"masthead_button_target_2";s:1:"0";s:23:"masthead_button_theme_2";s:12:"btn-ol-white";}s:7:"ueydv4r";a:14:{s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:15:"color: #de1f42;";s:24:"pagelines_masthead_title";s:10:"Onze Bands";s:26:"pagelines_masthead_tagline";s:46:"Guilty records is op zoek naar vergeten muziek";s:22:"masthead_button_link_1";s:11:"?page_id=68";s:22:"masthead_button_text_1";s:10:"Meer weten";s:24:"masthead_button_target_1";s:1:"0";s:23:"masthead_button_theme_1";s:12:"btn-ol-white";s:22:"masthead_button_link_2";s:9:"www.nu.nl";s:22:"masthead_button_text_2";s:11:"Meld je aan";s:24:"masthead_button_target_2";s:1:"0";}s:7:"uofcxbm";a:12:{s:24:"pagelines_herounit_title";s:13:"Secret Sounds";s:24:"pagelines_herounit_image";s:55:"[pl_site_url]/wp-content/uploads/2014/05/SS-CR-Fr03.jpg";s:34:"pagelines_herounit_image_attach_id";s:2:"66";s:16:"herounit_reverse";s:1:"0";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:19:"herounit_left_width";s:5:"span8";s:20:"herounit_right_width";s:5:"span4";s:22:"herounit_button_target";s:1:"0";s:21:"herounit_button_theme";s:7:"primary";}s:7:"um5nfjw";a:12:{s:15:"icallout_format";s:6:"inline";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:15:"color: #FFFFFF;";s:13:"icallout_text";s:38:"Secret Sounds Complete Remasters op CD";s:18:"icallout_text_wrap";s:2:"h4";s:13:"icallout_link";s:10:"page_id=62";s:15:"icallout_target";s:1:"0";s:18:"icallout_link_text";s:16:"Direct bestellen";s:18:"icallout_btn_theme";s:12:"btn-ol-white";}s:7:"uj13a4a";a:9:{s:14:"pl_area_height";s:2:"60";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:16:"pl_area_parallax";s:11:"pl-parallax";s:14:"pl_area_repeat";s:1:"0";s:20:"pl_area_color_enable";s:1:"1";s:13:"pl_area_color";s:6:"D81C3B";}s:7:"ut3ye3v";a:10:{s:14:"mediabox_image";s:55:"[pl_site_url]/wp-content/uploads/2014/05/SS-CR-Fr03.jpg";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:34:"margin-top: 4%; margin-bottom: 2%;";s:14:"mediabox_align";s:4:"left";s:15:"mediabox_height";s:3:"200";s:17:"disable_centering";s:1:"0";s:6:"no_pad";s:1:"0";}s:7:"u0r1nzn";a:10:{s:15:"nextbox_content";s:918:"<h3>Secret Sound</h3> <p>Secret Sounds besloot in 1983 haar debuut plaat in eigen beheer uit te brengen. Het was het begin van het platenlabel Guilty Records. In die tijd niet ongebruikelijk bij minder op de hitparade gerichte bands. Het gaf muzikanten meer artistieke vrijheid en er was zeker een markt voor. <br />Wat nieuw was, was dat de band betrokken was bij alle facetten van ieder project van pre-poductie tot persing, van drukwerk tot promotie. Het label bleef door de band ook gehandhaafd bij gelimiteerde speciale releases en later bij in licentie door major labels uitgebrachte platen.<br />Guilty Records werd nieuw leven ingeblazen toen voorjaar 2013 de eerste Secret Sounds muziek als downloads verkrijgbaar werd op iTunes, Bandcamp.com en andere online stores. Met de uitgave van Secret Sounds Complete Remasters op CD, los en als Box-set, herwint Guilty nu ook zijn ode glans met fysieke releases.</p>";s:17:"nextbox_shortcode";s:1:"0";s:15:"nextbox_wpautop";s:1:"0";s:11:"nextbox_php";s:1:"0";s:12:"nextbox_divs";s:1:"0";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:16:"margin-left: 5%;";}}s:5:"draft";a:9:{s:10:"custom-map";a:1:{s:8:"template";a:3:{i:0;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areauxyzci5";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"uxyzci5";s:7:"content";a:1:{i:0;a:6:{s:6:"object";s:10:"PLMasthead";s:5:"clone";s:7:"ueydv4r";s:3:"sid";s:8:"masthead";s:4:"span";s:1:"8";s:6:"offset";s:1:"0";s:6:"newrow";s:5:"false";}}}i:1;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areau0tde47";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"u0tde47";s:7:"content";a:2:{i:0;a:6:{s:6:"object";s:9:"PLNextBox";s:5:"clone";s:7:"u0r1nzn";s:3:"sid";s:10:"pl-nextbox";s:4:"span";s:1:"6";s:6:"offset";s:1:"0";s:6:"newrow";s:5:"false";}i:1;a:6:{s:6:"object";s:17:"PageLinesMediaBox";s:5:"clone";s:7:"ut3ye3v";s:3:"sid";s:8:"mediabox";s:4:"span";s:1:"4";s:6:"offset";s:1:"1";s:6:"newrow";s:5:"false";}}}i:2;a:7:{s:4:"name";s:0:"";s:5:"class";s:0:"";s:2:"id";s:14:"pl_areauj13a4a";s:6:"object";s:13:"PLSectionArea";s:3:"sid";s:7:"pl_area";s:5:"clone";s:7:"uj13a4a";s:7:"content";a:1:{i:0;a:6:{s:6:"object";s:10:"PLICallout";s:5:"clone";s:7:"um5nfjw";s:3:"sid";s:8:"icallout";s:4:"span";s:2:"10";s:6:"offset";s:1:"1";s:6:"newrow";s:5:"false";}}}}}s:7:"uio3h1v";a:7:{s:11:"pl_area_pad";s:3:"0px";s:14:"pl_area_height";s:3:"325";s:16:"pl_area_parallax";s:11:"pl-parallax";s:18:"pl_area_background";s:49:"[pl_site_url]/wp-content/uploads/2014/05/Band.jpg";s:28:"pl_area_background_attach_id";s:2:"44";s:14:"pl_area_repeat";s:1:"0";s:20:"pl_area_color_enable";s:1:"0";}s:7:"uv7hznf";a:11:{s:18:"pl_standard_styles";s:15:"color: #de1f42;";s:24:"pagelines_masthead_title";s:10:"Onze Bands";s:26:"pagelines_masthead_tagline";s:46:"Guilty records is op zoek naar vergeten muziek";s:22:"masthead_button_link_1";s:21:"www.teamtreehouse.com";s:22:"masthead_button_text_1";s:10:"Meer weten";s:24:"masthead_button_target_1";s:1:"0";s:23:"masthead_button_theme_1";s:11:"btn-success";s:22:"masthead_button_link_2";s:9:"www.nu.nl";s:22:"masthead_button_text_2";s:11:"Meld je aan";s:24:"masthead_button_target_2";s:1:"0";s:23:"masthead_button_theme_2";s:12:"btn-ol-white";}s:7:"ueydv4r";a:14:{s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:15:"color: #de1f42;";s:24:"pagelines_masthead_title";s:10:"Onze Bands";s:26:"pagelines_masthead_tagline";s:46:"Guilty records is op zoek naar vergeten muziek";s:22:"masthead_button_link_1";s:11:"?page_id=68";s:22:"masthead_button_text_1";s:10:"Meer weten";s:24:"masthead_button_target_1";s:1:"0";s:23:"masthead_button_theme_1";s:12:"btn-ol-white";s:22:"masthead_button_link_2";s:9:"www.nu.nl";s:22:"masthead_button_text_2";s:11:"Meld je aan";s:24:"masthead_button_target_2";s:1:"0";}s:7:"uofcxbm";a:12:{s:24:"pagelines_herounit_title";s:13:"Secret Sounds";s:24:"pagelines_herounit_image";s:55:"[pl_site_url]/wp-content/uploads/2014/05/SS-CR-Fr03.jpg";s:34:"pagelines_herounit_image_attach_id";s:2:"66";s:16:"herounit_reverse";s:1:"0";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:19:"herounit_left_width";s:5:"span8";s:20:"herounit_right_width";s:5:"span4";s:22:"herounit_button_target";s:1:"0";s:21:"herounit_button_theme";s:7:"primary";}s:7:"um5nfjw";a:12:{s:15:"icallout_format";s:6:"inline";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:15:"color: #FFFFFF;";s:13:"icallout_text";s:38:"Secret Sounds Complete Remasters op CD";s:18:"icallout_text_wrap";s:2:"h4";s:13:"icallout_link";s:10:"page_id=62";s:15:"icallout_target";s:1:"0";s:18:"icallout_link_text";s:16:"Direct bestellen";s:18:"icallout_btn_theme";s:12:"btn-ol-white";}s:7:"uj13a4a";a:9:{s:14:"pl_area_height";s:2:"60";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:16:"pl_area_parallax";s:11:"pl-parallax";s:14:"pl_area_repeat";s:1:"0";s:20:"pl_area_color_enable";s:1:"1";s:13:"pl_area_color";s:6:"D81C3B";}s:7:"ut3ye3v";a:10:{s:14:"mediabox_image";s:55:"[pl_site_url]/wp-content/uploads/2014/05/SS-CR-Fr03.jpg";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:34:"margin-top: 4%; margin-bottom: 2%;";s:14:"mediabox_align";s:4:"left";s:15:"mediabox_height";s:3:"200";s:17:"disable_centering";s:1:"0";s:6:"no_pad";s:1:"0";}s:7:"u0r1nzn";a:10:{s:15:"nextbox_content";s:918:"<h3>Secret Sound</h3> <p>Secret Sounds besloot in 1983 haar debuut plaat in eigen beheer uit te brengen. Het was het begin van het platenlabel Guilty Records. In die tijd niet ongebruikelijk bij minder op de hitparade gerichte bands. Het gaf muzikanten meer artistieke vrijheid en er was zeker een markt voor. <br />Wat nieuw was, was dat de band betrokken was bij alle facetten van ieder project van pre-poductie tot persing, van drukwerk tot promotie. Het label bleef door de band ook gehandhaafd bij gelimiteerde speciale releases en later bij in licentie door major labels uitgebrachte platen.<br />Guilty Records werd nieuw leven ingeblazen toen voorjaar 2013 de eerste Secret Sounds muziek als downloads verkrijgbaar werd op iTunes, Bandcamp.com en andere online stores. Met de uitgave van Secret Sounds Complete Remasters op CD, los en als Box-set, herwint Guilty nu ook zijn ode glans met fysieke releases.</p>";s:17:"nextbox_shortcode";s:1:"0";s:15:"nextbox_wpautop";s:1:"0";s:11:"nextbox_php";s:1:"0";s:12:"nextbox_divs";s:1:"0";s:23:"pl_standard_nouser_hide";s:1:"0";s:21:"pl_standard_user_hide";s:1:"0";s:23:"pl_standard_mobile_hide";s:1:"0";s:24:"pl_standard_desktop_hide";s:1:"0";s:18:"pl_standard_styles";s:16:"margin-left: 5%;";}}}"
] 

Share this post


Link to post
Share on other sites
greenfly

I will ask simon to take a look at this for you. 


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
Simon
How are you getting that json?
What data/info are you looking for in the post?

Share this post


Link to post
Share on other sites
BBKing
Hi Simon,

I get this output with the use of a JSON plugin in Wordpress, like I mentioned I the post above. The first part of the output is well constructed JSON from my point of view. The part starting at the point "custom field" PL- Settings is actually the part I am interested in because it's the content of the page with the text, referrals to images etc. it seems to me that the plugin is having a hard time to structure that part because all the pagelines code is not filtered out. Hope I explained it correctly. Perhaps it's simply not possible to filter the pagelines CSS and JavaScript code and parse it to well structured XML like the first part.

Thanks.

Share this post


Link to post
Share on other sites
Simon
pl-settings is an array of settings, WordPress stores all arrays and objects in the database as serialized strings, so you need to decode it by unserializing it.

Share this post


Link to post
Share on other sites
BBKing
Hi Simon,

Thanks! And understood. :-) I am familiar with unserializing. Because I am not so familiar with JSON yet I thought the output was so unstructured that it was to early for unserializing.

Anyhow many thanks!

Share this post


Link to post
Share on other sites

  • Similar Content

    • webmktco
      By webmktco
      I'm in the midst of launching a staging site to live and I'm running into issues with textboxes having the wrong URL structure.
      For example, it has domain.com instead of www.domain.com... this only happens in textboxes. 
      My migration process is:
      Migrate using BackupBuddy I also use the Advanced: Database Mass Text Replacement feature. Download pl-config JSON file, search/replace http:\/\/domain.com with http:\/\/www.domain.com But I still see the non-www URLs in the text boxes.
      Can you please help? Here's the debug info: http://www.jenningsortho.com/?pldebug=1.
       
    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
×