Afficher des vidéos de YouTube avec YQL

Pour lister des vidéos de Youtube on utilise la boucle DATA de SPIP 3 ainsi qu’une recherche sur Youtube via YQL

Le code

  1. <B_youtube>
  2. <ul class="thumbnails">
  3. <BOUCLE_youtube(DATA)
  4. {source yql, "select * from youtube.search(50) where query='spip'"}
  5. {datapath query/results/video}
  6. {pagination 9}>
  7. <li class="span2">
  8. <a class="thumbnail" style="height:200px" href="#URL">
  9. <img src="#VALEUR{thumbnails/thumbnail/0/content}" />
  10. <h3>#VALEUR{title}</h3>
  11. </a>
  12. </li>
  13. </BOUCLE_youtube>
  14. </ul>
  15. [<div class='pagination'>(#PAGINATION{page})</div>]
  16. </B_youtube>

Télécharger

Le résultat

Aucun résultat

Et voilà le travail !

CKAN API

CKAN est un outil de gestion/publication d’entrepôt OpenData assez largement utilisé. Il propose une API REST qui permet d’interroger l’entrepôt pour rechercher, lister et récupérer des jeux de données, le tout au format JSON.

L’interrogation de cette API se fait donc simplement à travers la méthode JSON.

Un exemple tiré de la documentation de l’API CKAN.

Le code

  1. <dl>
  2. <BOUCLE_ckan(DATA)
  3. {source json, http://demo.ckan.org/api/3/action/group_list?id=data_explorer}>
  4. <dt>#CLE</dt>
  5. <dd>[(#VALEUR|print)]</dt>
  6. </BOUCLE_ckan>
  7. </dl>

Télécharger

Le résultat

help
https://demo.ckan.org/api/3/action/help_show?name=group_list
success
1
result
20171211, agricoltura-pesca-silvicoltura-e-prodotti-alimentari, arthormore, ashdbashashash, balagroup2, balagrp1, balagrp2, balagrp3, bangaloregroupo, ckan-test-group, clarity-h2020-eu, cloudwick1, cog-gis, data-explorer, demo-group, demor, dgti, economia, economie, emails, exper-group, fchargroup, fctest, fng, fons-municipal-catalegs-de-les-series-d-urbanisme, fons-particulars, formazione, geo-examples, gewoiwopie, group-1, group-23, group_nak, group-test-22-06-2017, grup, grup2, grup3, grupa-1, grupa-2, grupa-3, grupaabbcc, grupo-l, grupo-wadus, gruppo-di-esempio, harvesterdemo, hjk, housing, instruments, interesting, jamproject001, jamproject123456, jeju-library-management, journal-of-classical-studies, kominfo, kompjuteri, luclipse1, luclipse2, mahmoudgroup1, matsudah2, mundo3, mydata1, myfirstgroup, my-g, my-gfriend, mygroup, my-group, my-testgroup, newgroup, new-group-demo, opendata, open-source, parana, passa, paulo, populate-grupo-a, product1, qwerty, sadfasf-wwr2r2sdfasdfas, schwendermarkt, secret, serpro, staff, sumithra_group, syn-odi-catalog, test, test1, test-ckan2, testd, test-desu-yo, teste2, testegabriel, test-gr, testgroup, test_group, test-group, testgroup1, test-group-1, test-group111111, testgroup2, test-group22332, testgroups, test-groups17, testie, test-mctest, testorg12345, test-organisationn-group, test-terry, test-test, tokyo__, tokyo_test1023, toukei, toukei2, trans, transport_verkehr, turismo-master-bd, turkey, very-special-group, wahoo, wise, wise-1, zackgroup

Dans un second exemple, on fait une recherche de jeux de données sur un mot clé "spending" :

Le code

  1. <dl>
  2. <BOUCLE_ckan(DATA)
  3. {source json, http://demo.ckan.org/api/3/action/package_search?q=spending}>
  4. <dt>#CLE</dt>
  5. <dd>[(#VALEUR|print)]</dt>
  6. </BOUCLE_ckan>
  7. </dl>

Télécharger

Le résultat

help
https://demo.ckan.org/api/3/action/help_show?name=package_search
success
1
result

count: 4
sort: score desc, metadata_modified desc
facets:
results:
 0:
  license_title:
  maintainer:
  relationships_as_object:
  private:
  maintainer_email:
  num_tags: 3
  id: b9076e40-80ea-480b-b330-e399d7a8c09b
  metadata_created: 2017-07-18T13:16:32.128034
  metadata_modified: 2017-11-08T09:52:51.933370
  author:
  author_email:
  state: active
  version:
  creator_user_id: bbe1265b-8ff1-4b39-a857-fc2e9eed2057
  type: dataset
  resources:
   0:
    mimetype: text/csv
    cache_url:
    hash: f4f94ec6f3297e608a562434e52a3993a3c3f7e4
    description: December 2011
    name: December 2011
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/december_2011.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-07-18T13:16:32.204680
    state: active
    mimetype_inner:
    last_modified: 2012-03-13T22:04:31.993982
    position: 0
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: 0c2bd47a-6ac5-412e-a337-1b45a952e07e
    resource_type: file
    size: 1081957
   1:
    mimetype:
    cache_url:
    hash:
    description: November 2011
    name: November 2011
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/november_2011.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-07-18T13:16:32.204696
    state: active
    mimetype_inner:
    last_modified:
    position: 1
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: 52a0c92e-99a3-427d-93a6-73ef5cdccc11
    resource_type: file
    size:
   2:
    mimetype: text/csv
    cache_url:
    hash: 93762ff3919569fb9280de38ad62dff8c2a1473d
    description: October 2011
    name: October 2011
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/october_2011.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-07-18T13:16:32.204705
    state: active
    mimetype_inner:
    last_modified: 2012-03-13T22:04:28.872581
    position: 2
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: 1d1c9089-7037-48a3-a70d-fbecf146238f
    resource_type: file
    size: 850440
   3:
    mimetype: text/csv
    cache_url:
    hash: 1a7a576dfd490153f6097602bb64a2312079aa47
    description: September 2011
    name: September 2011
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/september_2011.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2012-06-06T15:54:48.643419
    state: active
    mimetype_inner:
    last_modified: 2012-06-13T07:57:00.966643
    position: 3
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: ff9038ef-41fd-4b00-9b1e-e942fbdaaf25
    resource_type: file
    size: 764773
   4:
    mimetype: text/csv
    cache_url:
    hash: 224ba4b7482d3cdd7e6b2373679a9cfaf8eb8dac
    description:
    name: January 2012
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/january_2012.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2012-08-14T12:39:24.519707
    state: active
    mimetype_inner:
    last_modified: 2012-08-14T12:39:35.638235
    position: 4
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: d51c9bd4-8256-4289-bdd7-962f8572efb0
    resource_type: file
    size: 1080880
   5:
    mimetype: text/csv
    cache_url:
    hash: 4cd5541587fe172ceaf59dc941e00b755ff1bdb5
    description:
    name: February 2012
    format: CSV
    url: http://www.newcastle.gov.uk/sites/drupalncc.newcastle.gov.uk/files/wwwfileroot/your-council/local_transparency/february_2012.csv
    datastore_active: 1
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2012-08-14T12:47:25.494670
    state: active
    mimetype_inner:
    last_modified: 2012-08-14T12:47:35.250641
    position: 5
    revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
    url_type:
    id: 5b958b29-a399-41aa-86ff-1d198a124140
    resource_type: file
    size: 951982
   6:
    mimetype:
    cache_url:
    hash:
    description:
    name:
    format:
    url:
    datastore_active:
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-10-10T10:59:17.956483
    state: active
    mimetype_inner:
    last_modified:
    position: 6
    revision_id: 0282f387-916b-46c5-9b90-6ac87bcdbae3
    url_type:
    id: 4542f583-e017-45f4-bd17-0ca9909542f7
    resource_type:
    size:
   7:
    mimetype:
    cache_url:
    hash:
    description:
    name:
    format:
    url:
    datastore_active:
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-10-10T10:59:35.880697
    state: active
    mimetype_inner:
    last_modified:
    position: 7
    revision_id: ba006e26-6540-4728-9cc9-9a0140409b2f
    url_type:
    id: 9ce8e694-3ab8-48b2-8774-6178c172bd38
    resource_type:
    size:
   8:
    mimetype:
    cache_url:
    hash:
    description: short description
    name: Polish portal
    format: application/x-perl
    url: http://onet.pl
    datastore_active:
    cache_last_updated:
    package_id: b9076e40-80ea-480b-b330-e399d7a8c09b
    created: 2017-11-08T09:52:52.222846
    state: active
    mimetype_inner:
    last_modified:
    position: 8
    revision_id: ba006e26-6540-4728-9cc9-9a0140409b2f
    url_type:
    id: 6b95e76f-89ff-4ed5-ac44-dccc0f7cd9a2
    resource_type:
    size:
  num_resources: 9
  tags:
   0:
    vocabulary_id:
    state: active
    display_name: city-newcastle-upon-tyne
    id: 8a3e0bc8-a178-4669-9eb0-c0c763acc824
    name: city-newcastle-upon-tyne
   1:
    vocabulary_id:
    state: active
    display_name: country.uk
    id: 16c3e784-d1a8-4f67-9335-74c7b3ec39d4
    name: country.uk
   2:
    vocabulary_id:
    state: active
    display_name: spending
    id: 46d73914-9e2b-43b8-b079-2195266aff31
    name: spending
  groups:
   0:
    display_name: Data Explorer Examples
    description: This group contains various real datasets that show CKAN’s data previewer in action. The previewer shows a configurable grid view of tabular data, plots columns of data on a graph, and shows geo-coded data on an interactive map. It can also preview image files and web pages.
    image_display_url: http://farm8.staticflickr.com/7129/7041988029_411d985015_c.jpg
    title: Data Explorer Examples
    id: 93327dc5-7615-4e11-bf17-974d30692ca5
    name: data-explorer
  license_id:
  relationships_as_subject:
  organization:
  name: newcastle-city-council-payments-over-500
  isopen:
  url: http://www.newcastle.gov.uk/your-council/local-transparency/payments-over-500
  notes: Newcastle City Council spending data over £500. Data is published monthly and shows who was paid, how much was paid, and what this was for. This will include : * all items we purchase * payments we make to contractors carrying out work on our behalf * other spend we incur in carrying out our business. What will be excluded : * payments made to staff * housing benefit payments * sensitive social services information which could put * vulnerable individuals at risk * personal information, such as the names of individuals receiving payments * confidential information, such as council tax or business rate refund. The site offers monthly spending reports, only the last three are included here.
  owner_org:
  extras:
   0:
    key: spatial
    value: { "type" : "Polygon", "coordinates" : [ [ [-1.5308, 54.9588],[-1.5308, 55.0796], [-1.7753, 55.0796], [-1.7753, 54.9588], [-1.5308, 54.9588] ] ] }
   1:
    key: spatial-text
    value: Newcastle upon Tyne, North East England, England, United Kingdom
  title: Newcastle City Council : Payments over £500
  revision_id: 746c4bc2-7666-4519-a008-13ed98161b03
 1:
  license_title: License not specified
  maintainer:
  relationships_as_object:
  private:
  maintainer_email:
  num_tags: 4
  id: beb6c3a6-098d-4389-b0a2-de0243728b42
  metadata_created: 2017-07-18T13:16:28.631451
  metadata_modified: 2017-07-18T13:16:28.631468
  author: Lucy Chambers
  author_email:
  state: active
  version:
  creator_user_id: bbe1265b-8ff1-4b39-a857-fc2e9eed2057
  type: dataset
  resources:
   0:
    mimetype:
    cache_url:
    hash:
    description: Adur District Council April 2009
    name:
    format: CSV
    url: http://ckan.net/storage/f/file/3ffdcd42-5c63-4089-84dd-c23876259973
    datastore_active:
    cache_last_updated:
    package_id: beb6c3a6-098d-4389-b0a2-de0243728b42
    created: 2017-07-18T13:16:28.648926
    state: active
    mimetype_inner:
    last_modified:
    position: 0
    revision_id: 7e854221-ec7f-4cad-b0f6-061406138181
    url_type:
    id: 281dffa6-ea9b-4446-be41-05dced06591f
    resource_type: file
    size:
   1:
    mimetype:
    cache_url:
    hash:
    description: Mapping Metadata for Adur
    name:
    format: JSON
    url: http://ckan.net/storage/f/file/c8ce520c-c2e6-463a-99a3-ad24b023ccb4
    datastore_active:
    cache_last_updated:
    package_id: beb6c3a6-098d-4389-b0a2-de0243728b42
    created: 2017-07-18T13:16:28.648955
    state: active
    mimetype_inner:
    last_modified:
    openspending_hint: model
    position: 1
    revision_id: 7e854221-ec7f-4cad-b0f6-061406138181
    url_type:
    id: 6cce3936-b169-4d12-82ba-65fcb79734a0
    resource_type: file
    size:
   2:
    mimetype:
    cache_url:
    hash:
    description: Revised CSV for import
    name:
    format: CSV
    url: http://mk.ucant.org/info/data/adur.csv
    datastore_active: 1
    cache_last_updated:
    package_id: beb6c3a6-098d-4389-b0a2-de0243728b42
    created: 2017-07-18T13:16:28.648967
    state: active
    mimetype_inner:
    last_modified:
    openspending_hint: data
    position: 2
    revision_id: 7e854221-ec7f-4cad-b0f6-061406138181
    url_type:
    id: 04127ad5-77e5-4a08-9f40-12d3c383e460
    resource_type: file
    size:
  num_resources: 3
  tags:
   0:
    vocabulary_id:
    state: active
    display_name: country-uk
    id: e0e95afd-325c-4b02-bea9-b08955b6b5b7
    name: country-uk
   1:
    vocabulary_id:
    state: active
    display_name: date-2009
    id: 4ec89897-b3ae-4dd5-b4ca-fac9129540ac
    name: date-2009
   2:
    vocabulary_id:
    state: active
    display_name: openspending
    id: d8bfaad5-6d65-4388-91cb-95e31e7a2dc0
    name: openspending
   3:
    vocabulary_id:
    state: active
    display_name: regional
    id: 2ce67eb3-6022-47f9-b135-f6fd23d78804
    name: regional
  groups:
   0:
    display_name: Data Explorer Examples
    description: This group contains various real datasets that show CKAN’s data previewer in action. The previewer shows a configurable grid view of tabular data, plots columns of data on a graph, and shows geo-coded data on an interactive map. It can also preview image files and web pages.
    image_display_url: http://farm8.staticflickr.com/7129/7041988029_411d985015_c.jpg
    title: Data Explorer Examples
    id: 93327dc5-7615-4e11-bf17-974d30692ca5
    name: data-explorer
  license_id: notspecified
  relationships_as_subject:
  organization:
  name: adur_district_spending
  isopen:
  url: http://www.spotlightonspend.org.uk/Downloads/1038
  notes: From Spikes Cavell, Spotlight on Spend. For Ardur, records from April 2009-March 2010 are currently available (2011-008-04)
  owner_org:
  extras:
   0:
    key: spatial
    value: { "type" : "Polygon", "coordinates" : [ [ [-0.3715, 50.8168],[-0.3715, 50.8747], [-0.2155, 50.8747], [-0.2155, 50.8168], [-0.3715, 50.8168] ] ] }
   1:
    key: spatial-text
    value: Adur, West Sussex, South East England, England, United Kingdom
  title: UK : Adur District Council Spending Data
  revision_id: 7e854221-ec7f-4cad-b0f6-061406138181
 2:
  license_title: Creative Commons Attribution
  maintainer: Francisco Javier Flores Flores Palacios
  relationships_as_object:
  private:
  maintainer_email: javierfjfp94@gmail.com
  num_tags: 3
  id: 64724bf1-69cd-4e33-9fc0-0c6577e6ccf9
  metadata_created: 2017-10-16T19:59:08.910129
  metadata_modified: 2017-10-16T20:36:18.284659
  author: Francisco Javier Flores Flores Palacios
  author_email: javierfjfp94@gmail.com
  state: active
  version:
  creator_user_id: f1353947-5168-49c4-8ff6-91dd376a27f5
  type: dataset
  resources:
   0:
    mimetype:
    cache_url:
    hash:
    description: A pdf report with information about the situation of the education in London (quality, expected progress, comparison with the national average, level of students...)
    name: London Annual Education Report 2015
    format: PDF
    url: https://files.datapress.com/london/dataset/london-annual-education-report-2015/2015-12-01T08:54:32/GLA Annual Education Report 2015.pdf
    datastore_active:
    cache_last_updated:
    package_id: 64724bf1-69cd-4e33-9fc0-0c6577e6ccf9
    created: 2017-10-16T20:02:37.944433
    state: active
    mimetype_inner:
    last_modified:
    position: 0
    revision_id: 411c5f3a-2c64-4870-960a-7fa8aabd2e85
    url_type:
    id: d7de25a5-c6b8-4b2e-9c6f-05b1319c3092
    resource_type:
    size:
   1:
    mimetype:
    cache_url:
    hash:
    description: A kmz file with allows to display in a map a layer with the position of each school, name, type, districts...
    name: London Schools Atlas
    format: KMZ
    url: https://demo.ckan.org/dataset/64724bf1-69cd-4e33-9fc0-0c6577e6ccf9/resource/3b0db5c2-2916-4a1c-877e-9a22e70e7372/download/all_schools_2016.kmz
    datastore_active:
    cache_last_updated:
    package_id: 64724bf1-69cd-4e33-9fc0-0c6577e6ccf9
    created: 2017-10-16T20:18:36.300994
    state: active
    mimetype_inner:
    last_modified:
    position: 1
    revision_id: ae304e0c-fcb3-4bed-8044-e33ebfc65c6a
    url_type: upload
    id: 3b0db5c2-2916-4a1c-877e-9a22e70e7372
    resource_type:
    size:
   2:
    mimetype:
    cache_url:
    hash:
    description: A csv file containing a table with results of a statistical research about children who spend at least two hours per week at school sports.
    name: Physically active children
    format: CSV
    url: https://files.datapress.com/london/dataset/physically-active-children/active-children-borough.csv
    datastore_active: 1
    cache_last_updated:
    package_id: 64724bf1-69cd-4e33-9fc0-0c6577e6ccf9
    created: 2017-10-16T20:36:18.354770
    state: active
    mimetype_inner:
    last_modified:
    position: 2
    revision_id: ae304e0c-fcb3-4bed-8044-e33ebfc65c6a
    url_type:
    id: b998aff7-42db-49dc-9e41-f40b558b74b1
    resource_type:
    size:
  num_resources: 3
  tags:
   0:
    vocabulary_id:
    state: active
    display_name: education
    id: 2f9d6731-6d33-43d4-9110-291086bd38d5
    name: education
   1:
    vocabulary_id:
    state: active
    display_name: london
    id: 34bb18de-5162-4104-988d-1e322c4d980f
    name: london
   2:
    vocabulary_id:
    state: active
    display_name: uk
    id: 85de8bcc-fe5c-4821-9970-0b20e5d36f34
    name: uk
  groups:
  license_id: cc-by
  relationships_as_subject:
  organization:
   description: A little organization which collects dataset in regards to different matters concerning UK (safety situation, geography, urbanism...)
   title: UK_miscellany
   created: 2017-10-15T19:04:06.019403
   approval_status: approved
   is_organization: 1
   state: active
   image_url: https://www.flickr.com/photos/pablodamon/8129102935/in/photolist-dokM6a-feQvR7-7673Tn-8o5Auf-f6q9vC-cyZsi3-9JhKdB-5gf5HA-9MHLC9-8bkvxZ-dZzoEe-7d1Fi1-d5GKzJ-nwtuac-puUiXG-nwtPvg-9uCqVu-7zy512-4Kcztg-dQ7yG5-4gmbyh-696M7y-5E8xNi-fuW8Cv-7tscNf-dKQGm6-drWWoH-6zWVpy-ffib9V-9J4dMa-fa5Vpz-6Lz8zt-oLj1vs-dyx2CD-9fvNkx-cgs5nC-oMbmUU-ehTPd9-4SYrCe-dTj7S3-dat5Pa-egmRk6-ehCnCD-pYa7oj-pFizuD-kQ33R1-fJhCqe-kBKu1p-pLv97g-fBTMKK
   revision_id: d2ec77b5-3cb8-4df7-ae6a-110fdd8a81c1
   type: organization
   id: 57c79431-e719-44e5-a090-b5c8e577846c
   name: fjfp_organization
  name: education-in-london
  isopen: 1
  url: https://data.london.gov.uk/
  notes: Dataset storing different files concerning education sector : schools, universities, libraries...
  owner_org: 57c79431-e719-44e5-a090-b5c8e577846c
  extras:
  license_url: http://www.opendefinition.org/licenses/cc-by
  title: Education in London
  revision_id: 411c5f3a-2c64-4870-960a-7fa8aabd2e85
 3:
  license_title: License not specified
  maintainer:
  relationships_as_object:
  private:
  maintainer_email:
  num_tags: 0
  id: 6f7bf362-c29c-4f48-9990-b69e00b4c125
  metadata_created: 2017-07-18T13:17:04.817169
  metadata_modified: 2017-07-18T13:17:04.817188
  author: Simona De Luca, Aline Pennisi
  author_email:
  state: active
  version:
  creator_user_id: bbe1265b-8ff1-4b39-a857-fc2e9eed2057
  type: dataset
  resources:
   0:
    mimetype:
    cache_url:
    hash:
    description: Budget, 2 levels, CSV split
    name:
    format: CSV
    url: http://opendatalabs.org/italy/Italy-TOT-1996-2008-pubexp.csv
    datastore_active:
    cache_last_updated:
    package_id: 6f7bf362-c29c-4f48-9990-b69e00b4c125
    created: 2017-07-18T13:17:04.864317
    state: active
    mimetype_inner:
    last_modified:
    openspending_hint: data
    position: 0
    revision_id: 550f0b7c-7503-4428-8aef-88aee91c399c
    url_type:
    id: d81037dc-6fb8-46f9-a79a-2d447bc2b12b
    resource_type: file
    size:
   1:
    mimetype:
    cache_url:
    hash:
    description: OpenSpending Model
    name:
    format: JSON
    url: https://bitbucket.org/pudo/dpkg-italy-ra/raw/tip/model.js
    datastore_active:
    cache_last_updated:
    package_id: 6f7bf362-c29c-4f48-9990-b69e00b4c125
    created: 2017-07-18T13:17:04.864329
    state: active
    mimetype_inner:
    last_modified:
    openspending_hint: model
    position: 1
    revision_id: 550f0b7c-7503-4428-8aef-88aee91c399c
    url_type:
    id: 1b2b09d2-8673-45f4-8c79-0fb0cd896a11
    resource_type: file
    size:
  num_resources: 2
  tags:
  groups:
   0:
    display_name: Data Explorer Examples
    description: This group contains various real datasets that show CKAN’s data previewer in action. The previewer shows a configurable grid view of tabular data, plots columns of data on a graph, and shows geo-coded data on an interactive map. It can also preview image files and web pages.
    image_display_url: http://farm8.staticflickr.com/7129/7041988029_411d985015_c.jpg
    title: Data Explorer Examples
    id: 93327dc5-7615-4e11-bf17-974d30692ca5
    name: data-explorer
  license_id: notspecified
  relationships_as_subject:
  organization:
  name: italyregionalaccounts
  isopen:
  url: http://www.dps.tesoro.it/cpt/banca_dati_home.asp
  notes: The Regional Public Accounts (RPA) measure public financial flows at the regional level providing information on central and local government revenues and expenditures (either on current and capital account) by sector. Data is available since 1996 for General Government or the wider Public Sector and allows for analysis of various sub-aggregates covering different macro-areas and administrative regions, sector classifications, economic categories, definitions of government expenditure and final expenditure recipients. Data is produced by the Department for Development Policies, Ministry of Economic Development, ITALY and will be released in CSV/TXT format soon on the RPA website. Traduzione italiana : I Conti Pubblici Territoriali misurano i flussi finanziari pubblici a livello regionale fornendo informazioni sulle entrate e le spese (sia correnti che in conto capitale) delle amministrazioni centrali, regionali e locali per settore. I dati sono disponibili dal 1996 per il totale della pubblica amministrazione o il piu’ ampio settore pubblico e consente analisi di per diverse macro-aree, regioni, settori, categorie economiche, livelli di governo e beneficiari ultimi della spesa. I dati sono prodotti dal Dipartimento per lo Sviluppo e la Coesione Economica del Ministero dello Sviluppo economico italiano.
  owner_org:
  extras:
   0:
    key: currency
    value: EUR
  title: Italian Regional Public Accounts
  revision_id: 550f0b7c-7503-4428-8aef-88aee91c399c
search_facets:

Twitter API

L’exemple de l’API Twitter est intéressant, car c’est une API qui ne peut être intérrogée qu’au moyen d’un processus d’authentification OAuth, et non simplement en interrogeant une URL.

Nous utilisons pour ce faire le plugin Twitter pour SPIP qui intègre une méthode twitter pour la boucle (DATA).

Il devient alors aussi facile d’interroger Twitter à travers son API propriétaire que d’utiliser une simple API en REST :

Le code

  1. <B_tweets>
  2. <ul class='liste-items'>
  3. <BOUCLE_tweets(DATA)
  4. {source twitter,search/tweets?q=%23spip}
  5. {datapath statuses}
  6. {pagination 10}>
  7. <li class='item tweet'>
  8. <img src='#VALEUR{user/profile_image_url}' style='float:right' />
  9. <a href='http://twitter.com/#VALEUR{user/screen_name}'>
  10. @[(#VALEUR{user/screen_name})] (#VALEUR{user/name})
  11. </a> :
  12. <q>#VALEUR{text}</q>
  13. </li>
  14. </BOUCLE_tweets>
  15. </ul>
  16. [<div class='pagination'>(#PAGINATION{precedent_suivant})</div>]
  17. </B_tweets>

Télécharger

Le résultat

Aucun résultat