Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NumEco Ecologie Gouv
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
Numérique et Écologie
NumEco Ecologie Gouv
Commits
9c60d12f
Commit
9c60d12f
authored
1 year ago
by
CANÉVET Cindy
Browse files
Options
Downloads
Patches
Plain Diff
Correctifs cassure des urls affichés et filtrage des doublons d'articles
parent
7987c36c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
analyser/crawler.js
+15
-3
15 additions, 3 deletions
analyser/crawler.js
mkdocs/docs/css/main.css
+3
-0
3 additions, 0 deletions
mkdocs/docs/css/main.css
mkdocs/mkdocs.yml
+1
-0
1 addition, 0 deletions
mkdocs/mkdocs.yml
with
19 additions
and
3 deletions
analyser/crawler.js
+
15
−
3
View file @
9c60d12f
...
...
@@ -105,8 +105,9 @@ export async function getRendezvous(nbLinks) {
export
async
function
getPolPublicFile
(
pols
)
{
let
n
=
1
;
const
limit
=
250
;
for
(
let
i
=
0
;
i
<
pols
.
length
;
i
+=
limit
)
{
let
pol
=
pols
.
slice
(
i
,
(
i
+
limit
));
const
uniquePols
=
[...
new
Map
(
pols
.
map
(
pol
=>
[
pol
.
url
,
pol
])).
values
()]
for
(
let
i
=
0
;
i
<
uniquePols
.
length
;
i
+=
limit
)
{
let
pol
=
uniquePols
.
slice
(
i
,
(
i
+
limit
));
fs
.
writeFile
(
`target/polp
${
n
}
.json`
,
JSON
.
stringify
(
pol
),
(
err
)
=>
{
if
(
err
)
throw
err
;
});
...
...
@@ -114,7 +115,6 @@ export async function getPolPublicFile(pols) {
}
return
true
;
}
export
async
function
getPolPublics
(
nb
)
{
let
temp_urls
=
[];
const
all_urls
=
[];
...
...
@@ -190,6 +190,18 @@ async function getArticles({
if
(
dateParser
)
{
date
=
dateParser
(
date
);
}
const
test
=
toAbsoluteUrl
(
document
.
evaluate
(
xpathUrl
,
node
,
null
,
dom
.
window
.
XPathResult
.
STRING_TYPE
,
null
,
).
stringValue
,
);
if
(
test
===
'
https://www.ecologie.gouv.fr/achats-publics-durables
'
)
{
console
.
log
(
url
)
}
urls
.
push
({
url
:
toAbsoluteUrl
(
document
.
evaluate
(
...
...
This diff is collapsed.
Click to expand it.
mkdocs/docs/css/main.css
0 → 100644
+
3
−
0
View file @
9c60d12f
table
tr
td
:first-child
a
{
word-break
:
break-word
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
mkdocs/mkdocs.yml
+
1
−
0
View file @
9c60d12f
...
...
@@ -32,6 +32,7 @@ extra_javascript:
-
https://cdn.jsdelivr.net/npm/vega-lite@5
-
https://cdn.jsdelivr.net/npm/vega-embed@6
extra_css
:
-
css/main.css
-
css/tablesort.css
theme
:
name
:
null
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment