Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feldmannreferendum
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
Jan Eggers
feldmannreferendum
Commits
1bce4738
Commit
1bce4738
authored
2 years ago
by
untergeekDE
Browse files
Options
Downloads
Patches
Plain Diff
Library-Lademechanismus umgestellt; this.path v1.02
parent
55336e73
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
R/lies_aktuellen_stand.R
+0
-1
0 additions, 1 deletion
R/lies_aktuellen_stand.R
R/messaging.R
+8
-3
8 additions, 3 deletions
R/messaging.R
R/update_feldmann.R
+22
-14
22 additions, 14 deletions
R/update_feldmann.R
with
30 additions
and
18 deletions
R/lies_aktuellen_stand.R
+
0
−
1
View file @
1bce4738
...
...
@@ -35,7 +35,6 @@ for (i in c(1:nrow(config_df))) {
archiviere
<-
function
(
df
,
a_directory
=
"daten/wahllokale"
)
{
if
(
!
dir.exists
(
a_directory
))
{
dir.create
(
a_directory
)
teams_warning
(
a_directory
,
" neu angelegt"
)
}
write_csv
(
df
,
paste0
(
a_directory
,
"/"
,
...
...
This diff is collapsed.
Click to expand it.
R/messaging.R
+
8
−
3
View file @
1bce4738
...
...
@@ -9,9 +9,14 @@ library(teamr)
#'
#' Kommunikation mit Teams
#'
#' Webhook wird als
#'
#'
#' Webhook wird als URL im Environment gespeichert. Wenn nicht dort, dann
# Webhook schon im Environment?
if
(
Sys.getenv
(
"WEBHOOK_REFERENDUM"
)
==
""
)
{
t_txt
<-
read_file
(
""
)
Sys.setenv
(
WEBHOOK_REFERENDUM
=
t_txt
)
}
teams_meldung
<-
function
(
...
,
title
=
"Feldmann-Update"
)
{
cc
<-
teamr
::
connector_card
$
new
(
hookurl
=
Sys.getenv
(
"WEBHOOK_REFERENDUM"
))
cc
$
title
(
paste0
(
title
,
" - "
,
lubridate
::
with_tz
(
lubridate
::
now
(),
...
...
This diff is collapsed.
Click to expand it.
R/update_feldmann.R
+
22
−
14
View file @
1bce4738
library
(
readr
)
library
(
lubridate
)
library
(
tidyr
)
library
(
stringr
)
library
(
dplyr
)
library
(
DatawRappr
)
library
(
pacman
)
# Laden und ggf. installieren
p_load
(
this.path
)
p_load
(
readr
)
p_load
(
lubridate
)
p_load
(
tidyr
)
p_load
(
stringr
)
p_load
(
dplyr
)
p_load
(
DatawRappr
)
rm
(
list
=
ls
())
# Aktuelles Verzeichnis als workdir
setwd
(
this.path
::
this.dir
())
# Aus dem R-Verzeichnis eine Ebene rauf
setwd
(
".."
)
source
(
"R/messaging.R"
)
source
(
"R/lies_aktuellen_stand.R"
)
...
...
@@ -148,20 +157,22 @@ if (neue_daten) {
if
(
fom_df
$
meldungen_anz
>
0
)
{
fom_update_str
<-
paste0
(
"<strong>Update OK</strong><br/><br/>"
,
fom_df
$
meldungen_anz
,
" von "
,
fom_df
$
meldungen_max
,
" Wahllokale ausgezählt "
,
fom_df
$
meldungen_anz
,
" von "
,
fom_df
$
meldungen_max
,
" Wahllokale ausgezählt "
,
"<ul><li><strong>Quorum zur Abwahl ist derzeit"
,
ifelse
(
fom_df
$
ja
/
fom_df
$
wahlberechtigt
<
0.3
,
" nicht "
,
" "
),
"erreicht</strong></li>"
,
"<li><strong>Anteil der Ja-Stimmen an den Wahlberechtigten: "
,
format
(
fom_df
$
ja
/
fom_df
$
wahlberechtigt
*
100
,
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
),
"</li><li>Ja-Stimmen: "
,
format
(
fom_df
$
ja
,
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
),
format
(
fom_df
$
ja
,
decimal.mark
=
","
,
big.mark
=
"."
),
"</li><li>Nein-Stimmen: "
,
format
(
fom_df
$
nein
,
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
),
format
(
fom_df
$
nein
,
decimal.mark
=
","
,
big.mark
=
"."
),
"</li><li>Verhältnis Ja:Nein: "
,
format
(
fom_df
$
ja
/
(
fom_df
$
ja
+
fom_df
$
nein
),
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
),
"% : "
,
format
(
fom_df
$
nein
/
(
fom_df
$
ja
+
fom_df
$
nein
),
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
),
"%</li></ul>"
,
format
(
fom_df
$
ja
/
fom_df
$
wahlberechtigt
,
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
)
,
format
(
fom_df
$
ja
/
fom_df
$
wahlberechtigt
,
decimal.mark
=
","
,
big.mark
=
"."
,
nsmall
=
1
,
digits
=
3
)
)
teams_meldung
(
fom_update_str
,
title
=
"Feldmann-Referendum"
)
...
...
@@ -170,7 +181,4 @@ if (neue_daten) {
teams_warning
(
"Neue Wahllokal-Daten, aber keine neuen Ortsdaten?"
)
}
}
# Auch hier TRUE zurückbekommen;; alles OK?
# Auch hier TRUE zurückbekommen;; alles OK?
\ No newline at end of file
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