Browse Source

Initial commit : saxon, tagsoup, ratp metro

Olivier Marty 8 years ago
commit
c89843940c
5 changed files with 29 additions and 0 deletions
  1. 5 0
      conf.sh
  2. 13 0
      query_metro
  3. 11 0
      ratp.sh
  4. BIN
      saxon.jar
  5. BIN
      tagsoup-1.2.jar

+ 5 - 0
conf.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# xquery processor
+xquery="java -cp saxon.jar:tagsoup-1.2.jar net.sf.saxon.Query"
+xquery_html="java -cp saxon.jar:tagsoup-1.2.jar net.sf.saxon.Query -x:org.ccil.cowan.tagsoup.Parser"

+ 13 - 0
query_metro

@@ -0,0 +1,13 @@
+<result>
+<images>
+{
+  for $img in //*:div[@class="line_details"]/*:img
+    return <img src="http://ratp.fr{ $img/@src }" alt="{ $img/@alt }"/>
+}
+</images>
+<horaires>
+{
+  //*:div[@id="prochains_passages"]//*:table
+}
+</horaires>
+</result>

+ 11 - 0
ratp.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+source ./conf.sh
+
+# usage : ratp_url_metro arret n°ligne A|R
+function ratp_url_metro {
+  echo "http://www.ratp.fr/horaires/fr/ratp/metro/prochains_passages/PP/"$1"/"$2"/"$3
+}
+
+# requete
+$xquery_html -q:query_metro -s:"$(ratp_url_metro "republique" 5 A)"

BIN
saxon.jar


BIN
tagsoup-1.2.jar