Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mathias-goebel
Last active March 9, 2016 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mathias-goebel/1904d32cce00d68cce86 to your computer and use it in GitHub Desktop.
Save mathias-goebel/1904d32cce00d68cce86 to your computer and use it in GitHub Desktop.
DHd2016.XQuery
xquery version "3.0";
let $url := xs:anyURI('https://www.conftool.pro/dhd2016/sessions.php'),
$persist:= false(),
$request-headers := (),
$node as node() := httpclient:get($url, $persist, $request-headers)//httpclient:body/*,
$origList := tokenize(
string-join(
$node//*[contains(@class, 'paper_author')]/
string-join(
replace(., '\d', '')
)
, ',')
, ',')
return
for $i in distinct-values($origList)
where count( $origList[. = $i] ) eq 4
return
$i
xquery version "3.0";
let $url := xs:anyURI('https://www.conftool.pro/dhd2016/sessions.php'),
$persist:= false(),
$request-headers := (),
$node as node() := httpclient:get($url, $persist, $request-headers)//httpclient:body/*,
$origList := tokenize(
string-join(
$node//*[contains(@class, 'paper_organisation')]/
string-join(
replace(., '\d|:|Germany|Schweiz|Deutschland|Österreich', '')
)
, ',')
, ',')
return
for $i in distinct-values($origList)
where count( $origList[. = $i] ) eq 5
return
$i
xquery version "3.0";
let $url := xs:anyURI('https://www.conftool.pro/dhd2016/sessions.php'),
$persist:= false(),
$request-headers := (),
$node as node() := httpclient:get($url, $persist, $request-headers)//httpclient:body/*,
$origList := $node//span[starts-with(., 'Ort:')]/following::*[1]/text()
return
for $i in distinct-values($origList)
where count( $origList[. = $i] ) gt 6
return
$i || ': ' || count( $origList[. = $i] )
xquery version "3.0";
let $url := xs:anyURI('https://www.conftool.pro/dhd2016/sessions.php'),
$persist:= false(),
$request-headers := (),
$node as node() := httpclient:get($url, $persist, $request-headers)//httpclient:body/*,
$origList := tokenize(
lower-case(
replace(
string-join(
$node//text()
)
, '\.|,|:|\(|\)|<|>|!|/|-|;|#|=|\}|\{|\-', '')
)
, ' ')
return
for $i in distinct-values($origList)[. != ''][. != ' ']
let $test := count( $origList[. = $i] )
where $test gt 10
return
$i || ': ' || $test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment