Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plenumsbot
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
Container 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gnom
plenumsbot
Commits
6bd1f1e0
Commit
6bd1f1e0
authored
1 year ago
by
gnom
Browse files
Options
Downloads
Patches
Plain Diff
code formatting
parent
0ef63462
No related branches found
Branches containing commit
Tags
v0.1.0
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.env_example
+1
-1
1 addition, 1 deletion
.env_example
src/config.rs
+5
-3
5 additions, 3 deletions
src/config.rs
src/main.rs
+6
-13
6 additions, 13 deletions
src/main.rs
with
12 additions
and
17 deletions
.env_example
+
1
−
1
View file @
6bd1f1e0
PB_BASEURL=wiki.example.com
/lib/exe/xmlrpc.php
PB_BASEURL=wiki.example.com
PB_TLS=true
PB_USERNAME=username
PB_PASSWORD=password
...
...
This diff is collapsed.
Click to expand it.
src/config.rs
+
5
−
3
View file @
6bd1f1e0
...
...
@@ -54,8 +54,10 @@ impl Config {
Ok
(
i
)
=>
return
Ok
(
i
),
Err
(
_
)
=>
return
Err
(
format!
(
"Unable to parse {} to i8"
,
var
)),
};
},
Err
(
_
)
=>
return
Err
(
format!
(
"Environment varibale {} is not set"
,
var
)
.to_string
()),
}
Err
(
_
)
=>
{
return
Err
(
format!
(
"Environment varibale {} is not set"
,
var
)
.to_string
())
}
};
}
...
...
@@ -154,4 +156,4 @@ impl Config {
protocol
,
self
.username
,
self
.password
,
self
.baseurl
);
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
src/main.rs
+
6
−
13
View file @
6bd1f1e0
...
...
@@ -149,7 +149,12 @@ fn update_startpage(
};
}
fn
update_plenum_list
(
config
:
&
Config
,
list_page
:
&
str
,
page
:
&
str
,
year
:
&
str
)
->
Result
<
(),
String
>
{
fn
update_plenum_list
(
config
:
&
Config
,
list_page
:
&
str
,
page
:
&
str
,
year
:
&
str
,
)
->
Result
<
(),
String
>
{
let
mut
content
=
match
get_page
(
config
,
list_page
)
{
Ok
(
c
)
=>
c
,
Err
(
err
)
=>
return
Err
(
err
),
...
...
@@ -216,18 +221,6 @@ fn main() {
log
::
debug!
(
"next plenum: {}"
,
next_date
);
log
::
debug!
(
"Namespace: {}"
,
config
.namespace
);
let
plenum_list_page
=
format!
(
"{}:start"
,
config
.namespace
);
match
update_plenum_list
(
&
config
,
&
plenum_list_page
,
format!
(
"{}:{}"
,
config
.namespace
,
next_date
)
.as_str
(),
date
.format
(
"%Y"
)
.to_string
()
.as_str
(),
)
{
Ok
(())
=>
(),
Err
(
err
)
=>
log
::
debug!
(
"{}"
,
err
),
};
// check if page for next week already exists
let
next_plenum_page
=
format!
(
"{}:{}"
,
config
.namespace
,
next_date
);
if
page_exists
(
&
config
,
&
next_plenum_page
)
{
...
...
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