Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tokenaufbereiter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
IMEBI
LimeSurvey
tokenaufbereiter
Compare revisions
31c8160cabcfa051e50416c934075f2958df257c to 115c6976f94f3acb21ea2e364515b1bc94d95e8b
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
imebi/limesurvey/tokenaufbereiter
Select target project
No results found
115c6976f94f3acb21ea2e364515b1bc94d95e8b
Select Git revision
Branches
main
Swap
Target
imebi/limesurvey/tokenaufbereiter
Select target project
imebi/limesurvey/tokenaufbereiter
1 result
31c8160cabcfa051e50416c934075f2958df257c
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Anpassung für die Sortierung von Emails
· 99bfaed2
richard beer
authored
10 months ago
99bfaed2
Erarbeitung um das validfrom tag für den EmailVersand zu setzen
· 115c6976
richard beer
authored
10 months ago
115c6976
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
function_load.R
+62
-2
62 additions, 2 deletions
function_load.R
main.r
+14
-2
14 additions, 2 deletions
main.r
with
76 additions
and
4 deletions
function_load.R
View file @
115c6976
...
...
@@ -30,7 +30,67 @@ if (length(commandArgs(trailingOnly = TRUE)) > 0) {
#create global variable for the readline-command
choice
<-
T
function_create_validfrom
<-
function
(
combinedDataFrame
){
#nrow(cleaned_df)
# Format für validfrom
# 2023-10-23 08:02
#erhöht den Tag immer um 1, damit das Skript ab dem nächsten Tag startet.
date
<-
paste
(
year
(
Sys.time
()),,,
sep
=
"-"
)
zyear
<-
year
(
Sys.time
())
zmonth
<-
month
(
Sys.time
())
zday
<-
day
(
Sys.time
())
+1
list_for_hour
<-
c
()
for
(
i
in
0
:
23
){
if
(
i
<
10
){
list_for_hour
<-
c
(
list_for_hour
,
paste0
(
zyear
,
"-"
,
zmonth
,
"-"
,
zday
,
" "
,
"0"
,
i
,
":00"
))
}
else
{
list_for_hour
<-
c
(
list_for_hour
,
paste0
(
zyear
,
"-"
,
zmonth
,
"-"
,
zday
,
" "
,
i
,
":00"
))
}
}
print
(
list_for_hour
)
# es werden 300-500 Mails in einer Stunde versendet.
# bei 24h werden somit zwischen 7200 und 12000 Mails versendet.
# bei 100.000 werten und 7200 Mails muss ich also über 14 Tage gehen.
# Erstelle einen leeren Vektor für die Datumswerte
date_values
<-
c
()
# Schleife von 0 bis 23 Stunden
for
(
i
in
0
:
23
)
{
# Erhöhe das Datum um eine Stunde
current_date
<-
start_date
+
hours
(
i
)
# Füge das Datum zum Vektor hinzu
date_values
<-
c
(
date_values
,
current_date
)
# Wenn die Stunde 23 ist, erhöhe den Tag um eins und setze die Stunde auf 0
if
(
i
==
23
)
{
start_date
<-
start_date
+
days
(
1
)
# Erhöhe den Tag um eins
start_date
<-
start_date
-
hours
(
23
)
# Setze die Stunde auf 0
}
}
anzahl_zeilen
<-
nrow
(
cleaned_df
)
# Schleife über die Anzahl der Zeilen
for
(
i
in
1
:
anzahl_zeilen
)
{
# Schreibe den aktuellen Wert in die Spalte 'column_name'
cleaned_df
$
validfrom
[
i
]
<-
date
# Aktualisiere den Wert nach jeweils 300 Zyklen
if
(
i
%%
300
==
0
)
{
date
<-
wert
+
1
}
}
combined_token_with_download
}
#first: define all functions:
...
...
@@ -338,4 +398,4 @@ function_end <- function(){
function_read_prompt
()
#dont use quit() -> it restarts your R-Studio
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
main.r
View file @
115c6976
...
...
@@ -31,7 +31,8 @@ suppressMessages({
library
(
readxl
)
library
(
writexl
)
library
(
tidyverse
)
library
(
lubridate
)
source
(
"./function_load.R"
)
source
(
"./download_get_key.R"
)
...
...
@@ -180,5 +181,16 @@ cleaned_df$remindercount <- "0"
cleaned_df
$
completed
<-
"N"
cleaned_df
$
usesleft
<-
"1"
#sort at the beginning of the dataframe
list_for_email_sort
<-
c
(
"Niki2007dc@gmx.com"
,
"Nadine.Glaser97@web.de"
,
"Jasmin.kroeber@gmx.de"
)
for
(
element
in
list_for_email_sort
){
specific_rows
<-
cleaned_df
[
cleaned_df
$
email
==
element
,
]
cleaned_df
<-
cleaned_df
[
cleaned_df
$
email
!=
element
,
]
cleaned_df
<-
rbind
(
specific_rows
,
cleaned_df
)
}
# after cleaning . start with the user query ####
function_start
()
\ No newline at end of file
function_start
()
This diff is collapsed.
Click to expand it.