Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
ru-bot-telegram
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CAAD
ru-bot-telegram
Commits
b30fb4a8
Commit
b30fb4a8
authored
3 months ago
by
Fernando K
Committed by
fmk17
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix crawler again
parent
76ba7977
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
crawler.py
+13
-3
13 additions, 3 deletions
crawler.py
seed.py
+10
-10
10 additions, 10 deletions
seed.py
with
23 additions
and
13 deletions
crawler.py
+
13
−
3
View file @
b30fb4a8
...
@@ -92,7 +92,7 @@ def get_location_days(
...
@@ -92,7 +92,7 @@ def get_location_days(
(
(
indicator
indicator
for
indicator
in
menu_item_indicators
for
indicator
in
menu_item_indicators
if
indicator
.
find_text
in
img
[
"
src
"
]
if
indicator
.
find_text
in
img
[
"
title
"
]
),
),
None
,
None
,
)
)
...
@@ -103,13 +103,23 @@ def get_location_days(
...
@@ -103,13 +103,23 @@ def get_location_days(
(
(
indicator
indicator
for
indicator
in
menu_item_indicators
for
indicator
in
menu_item_indicators
if
indicator
.
find_text
in
child
[
"
src
"
]
if
indicator
.
find_text
in
child
[
"
title
"
]
),
),
None
,
None
,
)
)
if
indicator
is
not
None
:
if
indicator
is
not
None
:
item_indicators
.
add
(
indicator
)
item_indicators
.
add
(
indicator
)
elif
child
.
text
.
strip
()
!=
""
:
elif
child
.
text
.
strip
()
!=
""
:
if
child
.
text
.
startswith
(
"
\n
"
):
items
.
append
(
MenuItem
(
name
=
item_name
,
indicators
=
frozenset
(
item_indicators
),
)
)
item_name
=
None
item_indicators
=
set
()
if
item_name
is
not
None
:
if
item_name
is
not
None
:
item_name
+=
"
"
+
child
.
text
.
strip
()
item_name
+=
"
"
+
child
.
text
.
strip
()
else
:
else
:
...
@@ -123,7 +133,7 @@ def get_location_days(
...
@@ -123,7 +133,7 @@ def get_location_days(
menus
.
append
(
menus
.
append
(
Menu
(
meal_name
=
title_node
.
text
.
strip
().
upper
(),
items
=
tuple
(
items
))
Menu
(
meal_name
=
title_node
.
text
.
strip
().
upper
(),
items
=
tuple
(
items
))
)
)
days
.
append
(
Day
(
date
=
date
(
y
,
m
,
d
),
date_raw
=
date_text
,
menus
=
menus
))
days
.
append
(
Day
(
date
=
date
(
y
,
m
,
d
),
date_raw
=
date_text
.
strip
()
,
menus
=
menus
))
cached_update_times
[
location
]
=
datetime
.
now
()
cached_update_times
[
location
]
=
datetime
.
now
()
location_days
=
LocationDays
(
location_days
=
LocationDays
(
...
...
This diff is collapsed.
Click to expand it.
seed.py
+
10
−
10
View file @
b30fb4a8
...
@@ -135,55 +135,55 @@ def get_seed_menu_item_indicators():
...
@@ -135,55 +135,55 @@ def get_seed_menu_item_indicators():
(
(
"
🌱
"
,
"
🌱
"
,
"
Indicado para veganos
"
,
"
Indicado para veganos
"
,
"
vegan
"
,
"
Indicado para
vegan
os
"
,
1
,
1
,
),
),
(
(
"
🌾
"
,
"
🌾
"
,
"
Contém glúten
"
,
"
Contém glúten
"
,
"
gl
u
ten
"
,
"
Contém
gl
ú
ten
"
,
2
,
2
,
),
),
(
(
"
🥛
"
,
"
🥛
"
,
"
Contém leite e/ou derivados
"
,
"
Contém leite e/ou derivados
"
,
"
lact
os
e
"
,
"
Contém leite e/ou derivad
os
"
,
3
,
3
,
),
),
(
(
"
🥩
"
,
"
🥩
"
,
"
Contém produtos de origem animal
"
,
"
Contém produtos de origem animal
"
,
"
carne
"
,
"
Contêm produtos de origem animal
"
,
4
,
4
,
),
),
(
(
"
🥚
"
,
"
🥚
"
,
"
Cont
é
m ovo
"
,
"
Cont
ê
m ovo
s
"
,
"
ovo
"
,
"
Contêm
ovo
s
"
,
5
,
5
,
),
),
(
(
"
🍯
"
,
"
🍯
"
,
"
Contém mel
"
,
"
Contém mel
"
,
"
mel
"
,
"
Contém
mel
"
,
6
,
6
,
),
),
(
(
"
⚠️
"
,
"
⚠️
"
,
"
Contém ingrediente(s) potencialmente alergênico(s)
"
,
"
Contém ingrediente(s) potencialmente alergênico(s)
"
,
"
daf04cd5-bacd-4ea4-91ce-48ea45cb0ac4
"
,
"
Contém ingrediente(s) potencialmente alergênico(s)
"
,
7
,
7
,
),
),
(
(
"
🐷
"
,
"
🐷
"
,
"
Contém produtos de origem suína
"
,
"
Contém produtos de origem suína
"
,
"
476bf979-2cbb-476b-8739-02ed26485235
"
,
"
Contêm produtos de origem suína
"
,
8
,
8
,
),
),
(
(
"
🌶️
"
,
"
🌶️
"
,
"
Contém pimenta
"
,
"
Contém pimenta
"
,
"
mel
"
,
"
Contém pimenta
"
,
9
,
9
,
),
),
]
]
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