Dobbiamo tenere in mente 2 cose importanti:
– Tutti i feed devono essere in formato JSON, con la medesima struttura.
– In base al tipo di contenuti, alcuni attributi differiranno da altri.
Nel seguente esempio, creeremo un feed che mostri gli ultimi 24 articoli del sito web istituzionale in COMUNICAPP . Sarà comunque simile se si volesse creare un feed che visualizzi altri articoli (basati su un tag ad esempio) o un feed contenga la risposta a una specifica ricerca.
{
"generated_in" : "0.010000 s",
"items" : [
{
"author" : "Author of the post",
"commentsEnabled" : true,
"commentsPostUrl" : "URL_API_COMMENTS",
"commentsUrl" : "URL_FEED_COMMENTS",
"content" : "...",
"date" : "2013-10-23T21:57:00+02:00",
"id" : 123456,
"images" : [
{
"id" : "image_123456",
"url" : "URL_ORIGINAL_IMAGE",
}
],
"largeThumbnail" : "URL_LARGE_THUMBNAIL",
"nbComments" : 12,
"smallThumbnail" : "URL_SMALL_THUMBNAIL",
"subtype" : "custom",
"summary" : "...",
"tumbnail" : "URL_THUMBNAIL",
"title" : "Title of the post",
"type" : "article",
"url" : "URL_POST",
},
...
],
"next_page" : "http://www.example.com/json.php?page=2",
"stat" : "ok",
"title" : "Example",
"url" : "http://www.example.com"
}
