Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Armory Dashboard
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Anton Sarukhanov
Armory Dashboard
Commits
7c7f7825
Commit
7c7f7825
authored
1 year ago
by
Anton Sarukhanov
Browse files
Options
Downloads
Patches
Plain Diff
uncommitted from prod
parent
69f8d406
No related branches found
No related tags found
No related merge requests found
Pipeline
#272
failed with stage
Stage:
in 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scraper.py
+11
-13
11 additions, 13 deletions
scraper.py
with
11 additions
and
13 deletions
scraper.py
+
11
−
13
View file @
7c7f7825
...
...
@@ -126,27 +126,25 @@ class FTLiveScraper(Scraper):
"""
BASE_URL
=
'
https://fencingtimelive.com
'
TOURNAMENTS_URL
=
urljoin
(
BASE_URL
,
'
tournaments/search/data?{query}
'
)
TOURNAMENTS_URL
=
urljoin
(
BASE_URL
,
'
tournaments/search/data
/advanced
?{query}
'
)
TOURNAMENT_URL
=
urljoin
(
BASE_URL
,
'
tournaments/eventSchedule/{tournament_id}
'
)
FENCERS_URL
=
urljoin
(
BASE_URL
,
'
events/competitors/data/{event_id}
'
)
EVENT_URL
=
urljoin
(
BASE_URL
,
'
events/view/{event_id}
'
)
START_FORMAT
=
'
%Y-%m-%dT%H:%M:%S.000Z
'
EVENT_DATETIME_FORMAT
=
'
%A %B %d, %Y %I:%M %p
'
DATE_MODE
=
-
2
# Last 30
days
SEARCH_FROM
=
timedelta
(
days
=
21
)
# Start search x days into future
MAX_AGO
=
timedelta
(
days
=
7
)
MAX_AHEAD
=
timedelta
(
days
=
7
)
def
list_tournaments
(
self
,
search
=
None
,
date_mod
e
=
None
,
search
_date
=
None
):
def
list_tournaments
(
self
,
search
=
None
,
from_dat
e
=
None
,
to
_date
=
None
):
"""
Get a list of tournaments in FTLive.
"""
if
not
search
_date
:
search
_date
=
date
.
today
()
+
self
.
SEARCH_FROM
if
not
dat
e_mod
e
:
date
_mode
=
self
.
DATE_MODE
if
not
from
_date
:
from
_date
=
date
.
today
()
-
self
.
MAX_AGO
if
not
to_
date
:
to_
date
=
date
.
today
()
+
self
.
MAX_AHEAD
args
=
{
'
search
'
:
search
or
''
,
'
today
'
:
search_date
,
'
date
'
:
date_mode
,
'
filter
'
:
'
Country
'
,
'
country
'
:
'
USA
'
,
'
tname
'
:
search
or
''
,
'
from
'
:
from_date
or
''
,
'
to
'
:
to_date
or
''
}
url
=
self
.
TOURNAMENTS_URL
.
format
(
query
=
urlencode
(
args
))
try
:
...
...
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