User:Alex skene/scratchpad/more external stuff: Difference between revisions
Alex skene (talk | contribs) Created page with "== 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 |Pnumb..." |
Alex skene (talk | contribs) |
||
(16 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
* http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml | * http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml | ||
{{# | {{#get_web_data: | ||
|xml | url=http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml | ||
| | |format=xml | ||
| | |use xpath | ||
|data=Text1=//*[local-name()='Text'] | |||
, text2=//*[local-name()='AffectingTitle'] | |||
|}} | |}} | ||
{{#for_external_table:<nowiki/> | {{#for_external_table:<nowiki/> | ||
* {{{ | * {{{Text2}}} | ||
}} | }} | ||
Line 33: | Line 31: | ||
{{#for_external_table:<nowiki/> | {{#for_external_table:<nowiki/> | ||
* {{{span}}} / {{{class}}} | * {{{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}}} | |||
}} | |||
3: | |||
{{#get_web_data: | |||
url=http://www.whatdotheyknow.com/feed/body/islington_borough_council.json | |||
|format=json | |||
|data=rcalculated_state=calculated_state,rinfo_request=info_request,rid=id,rtitle=title,rurl_title=url_title,rdisplay_status=display_status | |||
}} | |||
{{#for_external_table:<nowiki/> | |||
* {{{rid}}} / {{{rcalculated_state}}} / {{{rinfo_request}}} / {{{rtitle}}} / {{{rurl_title}}} / {{{rdisplay_status}}} | |||
}} | }} |
Latest revision as of 01:04, 18 October 2012
try xml
{{#get_web_data: url=http://www.legislation.gov.uk/ukpga/2000/36/section/11/data.xml |format=xml |use xpath |data=Text1=//*[local-name()='Text'] , text2=//*[local-name()='AffectingTitle'] |}}
{{#for_external_table:
- {{{Text2}}}
}}
- 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}}}
}}
3:
{{#get_web_data: url=http://www.whatdotheyknow.com/feed/body/islington_borough_council.json |format=json |data=rcalculated_state=calculated_state,rinfo_request=info_request,rid=id,rtitle=title,rurl_title=url_title,rdisplay_status=display_status }}
{{#for_external_table:
- {{{rid}}} / {{{rcalculated_state}}} / {{{rinfo_request}}} / {{{rtitle}}} / {{{rurl_title}}} / {{{rdisplay_status}}}
}}