User:Alex skene/scratchpad/more external stuff: Difference between revisions
From FOIwiki
Jump to navigationJump to search
NuMKJoddDT |
m Reverted edits by 4.71.200.50 (talk) to last revision by Alex skene |
||
Line 1: | Line 1: | ||
== try xml == | |||
* http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml | |||
{{#get_external_data:http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml | |||
|xml | |||
|Pnumber=Pnumber | |||
|P1para=P1para | |||
|P2para=P2para | |||
|P3para=P3para | |||
|P4para=P4para | |||
|Text=Text | |||
|}} | |||
{{#for_external_table:<nowiki/> | |||
* {{{Pnumber}}} / {{{Text}}} / {{{P1para}}} | |||
}} | |||
* the legislation xml doesn't meet the SMW extension's format v well, so won't e able format properly | |||
== try xht format == | |||
* http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xht | |||
* doesn't work well - more classes than spans... | |||
{{#get_external_data:http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xht | |||
|xml | |||
|span=span | |||
|class=class | |||
|}} | |||
{{#for_external_table:<nowiki/> | |||
* {{{span}}} / {{{class}}} | |||
}} | |||
== try json format == | |||
1: | |||
{{#get_web_data: | |||
url=http://www.whatdotheyknow.com/request/bnp_teachers_152.json | |||
|format=json | |||
|data=url_title=url_title,title=title,id=id | |||
}} | |||
{{#for_external_table:<nowiki/> | |||
* {{{url_title}}} / {{{title}}} / {{{id}}} | |||
}} | |||
2: | |||
{{#get_web_data: | |||
url=http://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=ico_lines_to_take&query=select%20*%20from%20ltt_data | |||
|format=json | |||
|data=snippet=snippet | |||
}} | |||
{{#for_external_table:<nowiki/> | |||
* {{{snippet}}} | |||
}} |
Revision as of 16:18, 22 July 2011
try xml
{{#get_external_data:http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml |xml |Pnumber=Pnumber |P1para=P1para |P2para=P2para |P3para=P3para |P4para=P4para |Text=Text |}}
{{#for_external_table:
- {{{Pnumber}}} / {{{Text}}} / {{{P1para}}}
}}
- the legislation xml doesn't meet the SMW extension's format v well, so won't e able format properly
try xht format
- http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xht
- doesn't work well - more classes than spans...
{{#get_external_data:http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xht |xml |span=span |class=class |}}
{{#for_external_table:
- {{{span}}} / {{{class}}}
}}
try json format
1:
{{#get_web_data: url=http://www.whatdotheyknow.com/request/bnp_teachers_152.json |format=json |data=url_title=url_title,title=title,id=id }}
{{#for_external_table:
- {{{url_title}}} / {{{title}}} / {{{id}}}
}}
2:
{{#get_web_data: url=http://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=ico_lines_to_take&query=select%20*%20from%20ltt_data |format=json |data=snippet=snippet }}
{{#for_external_table:
- {{{snippet}}}
}}