File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ Fusionner les données des prestataires SILL venant de l'ADULLACT et du CNLL.
3434
3535` bbin install https://git.sr.ht/~codegouvfr/codegouvfr-outils/blob/main/src/sill-prestataires.clj `
3636
37+ ## ` sill-create-latest-xml.clj `
38+
39+ Exporter le flux RSS ` latest-sill.xml ` à partir de https://code.gouv.fr/sill/api/sill.json .
40+
41+ ` bbin install https://git.sr.ht/~codegouvfr/codegouvfr-outils/blob/main/src/sill-create-latest-xml.clj `
42+
3743## ` annuaire-service-public-enrichi `
3844
3945Enrichi le ` .json ` de l'annuaire des services publics en ajoutant les
Original file line number Diff line number Diff line change 22 :description " Utilitaires pour code.gouv.fr"
33 :url " https://git.sr.ht/~codegouvfr/codegouvfr-outils"
44 :license {:name " Eclipse Public License - v 2.0"
5- :url " http://www.eclipse.org/legal/epl-v20.html" }}
5+ :url " http://www.eclipse.org/legal/epl-v20.html" }
6+ :deps {clj-rss/clj-rss {:mvn/version " 0.4.0" }}}
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bb
2+
3+ (require '[clj-rss.core :as rss])
4+
5+ (if-let [sill (try (:body (curl/get " https://code.gouv.fr/sill/api/sill.json" ))
6+ (catch Exception e (println (.getMessage e))))]
7+ (do (->> sill
8+ json/parse-string
9+ (sort-by #(java.util.Date. (get % " referencedSinceTime" )))
10+ reverse
11+ (take 10 )
12+ (map (fn [item]
13+ (let [link (str " https://code.gouv.fr/sill/detail?name=" (get item " name" ))]
14+ {:title (str " Nouveau logiciel au SILL : " (get item " name" ))
15+ :link link
16+ :guid link
17+ :description (get item " function" )
18+ :pubDate (.toInstant (java.util.Date. (get item " referencedSinceTime" )))})))
19+ (rss/channel-xml
20+ {:title " code.gouv.fr - Nouveaux logiciels libres au SILL - New SILL entries"
21+ :link " https://code.gouv.fr/data/latest-sill.xml"
22+ :description " code.gouv.fr - Nouveaux logiciels libres au SILL - New SILL entries" })
23+ (spit " latest-sill.xml" ))
24+ (println " Exported latest-sill.xml" ))
25+ (println " Count not get SILL data" ))
You can’t perform that action at this time.
0 commit comments