From 4e2c14275b6488bd028613af7d843ccee42652cf Mon Sep 17 00:00:00 2001 From: red Date: Fri, 5 Dec 2025 09:57:10 +0000 Subject: [PATCH] remove duplicate data value and set up my Robot ... --- .gitignore | 5 +++++ app/Models/Participant.php | 14 ++++++++++---- bot/.env.example | 4 ++++ bot/main.py | 5 +++++ .../2025_12_04_105253_add_participants_table.php | 1 - resources/views/livewire/pages/profile.blade.php | 6 +++++- 6 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 bot/.env.example create mode 100644 bot/main.py diff --git a/.gitignore b/.gitignore index c7cf1fa..1d6e686 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,8 @@ yarn-error.log /.nova /.vscode /.zed +/bin +/include +/lib +/lib64 +pyvenv.cfg diff --git a/app/Models/Participant.php b/app/Models/Participant.php index 803bd79..321ba6e 100644 --- a/app/Models/Participant.php +++ b/app/Models/Participant.php @@ -15,13 +15,10 @@ class Participant extends Model 'giving_id', 'prompt', 'submission_url', - 'desperate', 'token', ]; - protected $casts = [ - 'desperate' => 'boolean', - ]; + protected $appends = ['desperate']; public function receiver() { @@ -70,4 +67,13 @@ class Participant extends Model ->whereDoesntHave('receiver'); } + public function getDesperateAttribute(): bool + { + $gives = !is_null($this->giver); + $gets = !is_null($this->receiver); + + return ($gives && !$gets) || (!$gives && $gets); + } + + } diff --git a/bot/.env.example b/bot/.env.example new file mode 100644 index 0000000..115a034 --- /dev/null +++ b/bot/.env.example @@ -0,0 +1,4 @@ +SKETCHERS_UNITED_SESSION= +XSRF_TOKEN= +REMEMBER_WEB= +API_PASSWORD= diff --git a/bot/main.py b/bot/main.py new file mode 100644 index 0000000..56ba879 --- /dev/null +++ b/bot/main.py @@ -0,0 +1,5 @@ +- get chats page +- for each + - if seen_at is less than latest[created_at] + - get token url from api + - respond to that user diff --git a/database/migrations/2025_12_04_105253_add_participants_table.php b/database/migrations/2025_12_04_105253_add_participants_table.php index 578db7c..eaedf3e 100644 --- a/database/migrations/2025_12_04_105253_add_participants_table.php +++ b/database/migrations/2025_12_04_105253_add_participants_table.php @@ -22,7 +22,6 @@ return new class extends Migration $table->string('prompt')->nullable(); $table->string('submission_url')->nullable(); - $table->boolean('desperate')->default(false); $table->string('token'); $table->timestamps(); }); diff --git a/resources/views/livewire/pages/profile.blade.php b/resources/views/livewire/pages/profile.blade.php index 4c092eb..0895ac5 100644 --- a/resources/views/livewire/pages/profile.blade.php +++ b/resources/views/livewire/pages/profile.blade.php @@ -157,10 +157,14 @@ $cancelEditingSubmission = function () { {{$receiverPrompt}} Nothing yet, probably! + + - withdraw + - bot +

Are you done?

You will be able to link to your gift below once submissions are accepted on 22nd December.

- submissions will be accepted up until 10th of january + submissions will be accepted up until 5th of january but before then is much more appreciated! {{-- @if($isEditingSubmission)--}} {{--
--}}