Home > Technology FAQs > JSON and XML Code Examples

 
 

Create your own feed for FUSE

JSON and XML Code Examples

Watch out for extra nodes! A node should be just an array of objects, not an array of objects each of which contains a single node object since it’s redundant and doesn't play nicely.

Also, it's much better to have keys missing or with null value rather than ““ values. It saves space in transmission and it will be more clear: there is no value rather than there is a value and it is an empty text. The latter will cause issues for your facets (i.e. filters).


JSON Example

{

    "some_structure":{

        "a_collection":[

            {

                "link":"http://...",

                "title":"My Title",

                "other":"Long or short text here",

                "last_updated":"2016-01-01T12:25"

            },

            {

                "link":"http://...",

                "title":"My Title",

                "other":"Long or short text here",

                "last_updated":"2016-01-01T12:25"

            }

        ]

    }

}

XML Example

<SomeTag>

    <CollectionHere>

        <Item>

            <Link>http://...</Link>

            <Title>My Title</Title>

            <OtherTag>Long or Short Text Here</OtherTag>

            <LastUpdated>2016-01-01T12:25</LastUpdated>

        </Item>

        <Item>

            <Link>http://...</Link>

            <Title>My Title</Title>

            <OtherTag>Long or Short Text Here</OtherTag>

            <LastUpdated>2016-01-01T12:25</LastUpdated>

        </Item>

    </CollectionHere>

</SomeTag>

WHAT’S HAPPENING ON TWITTER