27 Commits

Author SHA1 Message Date
d20702f248 Fix OK button clicked : more elegant
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 1m52s
Test, build and push image to registry / build-image (push) Successful in 2m46s
2025-11-07 12:08:40 +01:00
5b5f35e9ce Fix OK button clicked
Some checks failed
Test, build and push image to registry / build-image (push) Has been cancelled
Test, build and push image to registry / phpunit-tests (push) Has been cancelled
2025-11-07 12:07:56 +01:00
fb2a346804 Cache
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 1m53s
Test, build and push image to registry / build-image (push) Successful in 26s
2025-11-07 10:44:15 +01:00
2611701d53 Fix giveaway prize name #2
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Successful in 4m22s
Test, build and push image to registry / build-image (push) Has been cancelled
2025-11-07 10:03:30 +01:00
c61750285a Fix giveaway prize name
Some checks failed
Test, build and push image to registry / build-image (push) Has been cancelled
Test, build and push image to registry / phpunit-tests (push) Has been cancelled
2025-11-07 10:02:30 +01:00
12280c6d54 Selenium Undetected Standalone Chromedriver README with bugfix
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 6m35s
Test, build and push image to registry / build-image (push) Successful in 5m6s
2025-11-07 09:10:29 +01:00
6853fbef46 Fix CICD caches
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 6m43s
Test, build and push image to registry / build-image (push) Successful in 5m41s
2025-11-06 23:49:24 +01:00
29077ed6d6 Added caches to CICD
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Successful in 8m28s
Test, build and push image to registry / build-image (push) Has been cancelled
2025-11-06 23:37:30 +01:00
a162bb2c1f Fix CI test
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Successful in 1m58s
Test, build and push image to registry / build-image (push) Has been cancelled
2025-11-06 23:32:29 +01:00
7d26440d0c Fix eldorado prices
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Failing after 1m33s
Test, build and push image to registry / build-image (push) Has been skipped
2025-11-06 23:29:49 +01:00
45a40ae999 Caption in english
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Failing after 1m31s
Test, build and push image to registry / build-image (push) Has been skipped
2025-11-06 17:40:28 +01:00
266d444922 Add empty tests/Unit directory
All checks were successful
Test, build and push image to registry / phpunit-tests (push) Successful in 1m53s
Test, build and push image to registry / build-image (push) Successful in 3m14s
2025-11-06 17:34:41 +01:00
24360d86b3 Put everything in same workflow
Some checks failed
Test, build and push image to registry / phpunit-tests (push) Failing after 1m58s
Test, build and push image to registry / build-image (push) Has been skipped
2025-11-06 17:28:44 +01:00
5ce8fbd444 fix php version
Some checks failed
Launch the PHPunit tests / phpunit-tests (push) Failing after 1m52s
Push image to registry / build-image (push) Has been cancelled
2025-11-06 17:25:31 +01:00
82460aa727 Only run if tests suceeded
Some checks failed
Push image to registry / build-image (push) Has been cancelled
Launch the PHPunit tests / phpunit-tests (push) Has been cancelled
2025-11-06 17:24:46 +01:00
4422e7564b Init Feature testing and test for Eldorado's text to float conversion
Some checks failed
Push image to registry / build-image (push) Successful in 4m10s
Launch the PHPunit tests / phpunit-tests (push) Failing after 1m50s
2025-11-06 17:18:01 +01:00
bcef42b58e Fix Eldorado text to float conversion and PSR-4 2025-11-06 17:16:36 +01:00
ea22c19d2b Notification Eldorado
All checks were successful
Push image to registry / build-image (push) Successful in 4m2s
2025-11-02 19:17:05 +01:00
c36d83e8b6 Reverted concurrent popup lookup
All checks were successful
Push image to registry / build-image (push) Successful in 3m6s
2025-11-01 16:48:17 +01:00
eb141f00e5 Fix wrong error logged
All checks were successful
Push image to registry / build-image (push) Successful in 3m3s
2025-11-01 15:37:48 +01:00
5cd0aea7c8 Fix "Waited 1 seconds for text [Sorry, your password was incorrect. Please double-check your password.]."
All checks were successful
Push image to registry / build-image (push) Successful in 3m3s
2025-11-01 15:27:53 +01:00
15c540dcad Added more job artifacts
All checks were successful
Push image to registry / build-image (push) Successful in 3m1s
2025-11-01 15:03:13 +01:00
a426d5c6c2 Fix eldorado prices are per 1K robux now
All checks were successful
Push image to registry / build-image (push) Successful in 3m53s
2025-11-01 14:57:49 +01:00
31ac892cbb Try to check for popup in concurrency
All checks were successful
Push image to registry / build-image (push) Successful in 3m35s
2025-11-01 14:45:26 +01:00
e1a6bd9d42 Fix "New massagin tab look" popup
Some checks failed
Push image to registry / build-image (push) Has been cancelled
2025-11-01 14:38:22 +01:00
0849a1fd42 CHanged Eldorado Robux Price Sentry Job artifact message
All checks were successful
Push image to registry / build-image (push) Successful in 3m12s
2025-10-24 08:27:38 +02:00
6b5619b232 Added job artifacts
All checks were successful
Push image to registry / build-image (push) Successful in 4m17s
2025-10-23 19:31:56 +02:00
11 changed files with 212 additions and 18 deletions

View File

@@ -1,12 +1,34 @@
name: Push image to registry
name: Test, build and push image to registry
on:
push:
branches:
- main
jobs:
phpunit-tests:
runs-on: ubuntu-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3.0'
- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Run PHPUnit tests
run: vendor/bin/phpunit --configuration phpunit.xml
build-image:
needs: phpunit-tests
if: success() && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
@@ -17,6 +39,13 @@ jobs:
registry: git.matthiasg.dev
username: ninluc
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Cache Docker layers (registry-backed)
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: buildx-cache-${{ github.sha }}
restore-keys: |
buildx-cache-
- name: Build and push
run: |
docker build -t git.matthiasg.dev/ninluc/datbrowser:latest .

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Browser\Jobs\EldoradoRobuxPriceSentry;
use App\Models\Job;
use App\Notification\Notification;
use App\Notification\Stringifiable;
use App\Notification\Stringifiable\StringifiableSimpleText;
class EldoradoRobuxPriceNotification extends Notification {
private float $price;
private float $threshold;
private string $link;
public function __construct(int $jobId, int $price, string $link) {
parent::__construct($jobId);
$this->price = $price;
$this->threshold = floatval(Job::find($jobId)->jobInfosTable()->get('eldorado_robux_price_threshold'));
$this->link = $link;
$this->setBody($this->generateBody());
}
private function generateBody() {
return new EldoradoRobuxPriceNotificationBody($this->price, $this->threshold, $this->link);
}
public function getTitle(): Stringifiable {
return new StringifiableSimpleText("Alerte Robux Eldorado 🤑");
}
/**
* @inheritDoc
*/
public function getImageProjectPath(): string|null {
return null;
}
/**
* @inheritDoc
*/
public function getLinkURL(): string|null {
return $this->link;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Browser\Jobs\EldoradoRobuxPriceSentry;
use App\Notification\NotificationBody;
class EldoradoRobuxPriceNotificationBody extends NotificationBody {
private float $price;
private float $threshold;
private string $link;
public function __construct(float $price, float $threshold, string $link) {
parent::__construct();
$this->price = $price;
$this->threshold = $threshold;
$this->link = $link;
}
/**
* @inheritDoc
*/
public function toMarkdownString(): string {
return "Le prix des Robux sur Eldorado est actuellement de **" . number_format($this->price, 7, ",", " ") . " €**/Robux, ce qui est inférieur ou égal au seuil de **" . number_format($this->threshold, 5, ",", " ") . " €**.\n\n[Voir l'offre sur Eldorado]( " . $this->link . " )";
}
/**
* @inheritDoc
*/
public function toString(): string {
return "Le prix des Robux sur Eldorado est actuellement de " . number_format($this->price, 7, ",", " ") . " €/Robux, ce qui est inférieur ou égal au seuil de " . number_format($this->threshold, 5, ",", " ") . " €.\n\nVoir l'offre sur Eldorado : " . $this->link;
}
}

View File

@@ -8,6 +8,7 @@ use App\Browser\Jobs\InstagramRepost\DescriptionPipeline\InstagramDescriptionPip
use App\Models\InstagramNotification;
use App\Models\InstagramRepost;
use App\Models\Job;
use App\Models\JobArtifact;
use App\Models\JobRun;
use App\Notification\Notifications\JobDebugNotification;
use App\Notification\Notifications\SimpleNotification;
@@ -92,33 +93,46 @@ class EldoradoRobuxPriceSentryJob extends BrowserJob implements ShouldBeUniqueUn
{
$lowestPriceElement = $browser->driver->findElement(WebDriverBy::xpath('(//eld-offer-price)[2]/strong'));
$lowestPriceText = $lowestPriceElement->getText(); // Ex: " 0,00478 € "
$lowestPrice = (float)str_replace(["", ","], ["", "."], trim($lowestPriceText));
$lowestPrice = $this->textToFloat($lowestPriceText);
//$lowestPrice = $lowestPrice / 1000; // Price per Robux
// TODO : Look at the entire text to try to understand if it is per 1k or per single Robux
$threshold = floatval(str_replace(",", ".", $this->jobInfos->get("eldorado_robux_price_threshold")));
dump($threshold);
$threshold = $this->textToFloat($this->jobInfos->get("eldorado_robux_price_threshold"));
Log::info("EldoradoRobuxPriceSentryJob: lowest price = $lowestPrice €, threshold = $threshold");
$this->jobRun->addArtifact(new JobArtifact([
"name" => "Trouvé le prix le plus bas",
"content" => "Prix le plus bas : $lowestPrice €/Robux - Seuil défini : $threshold €/Robux"
]));
if ($lowestPrice <= $threshold) {
$message = "Le prix des Robux sur Eldorado est actuellement de **" . number_format($lowestPrice, 5, ",", " ") . " €**/Robux, ce qui est inférieur ou égal au seuil de **" . number_format($threshold, 5, ",", " ") . " €**.\n\n[Voir l'offre sur Eldorado]( " . self::LINK . " )";
$options = [];
if ($this->jobInfos->get("eldorado_robux_price_discord_webhook") !== null) { // Custom discord webhook
$options["discord_webhook_url"] = $this->jobInfos->get("eldorado_robux_price_discord_webhook");
}
AllNotification::send(
new SimpleNotification(
new EldoradoRobuxPriceNotification(
$this->jobId,
"Alerte Robux Eldorado 🤑",
$message
$lowestPrice,
self::LINK
),
$options
);
$this->jobRun->addArtifact(new JobArtifact([
"name" => "Envoyé une alerte",
"content" => ""
]));
Log::info("EldoradoRobuxPriceSentryJob: alert sent");
} else {
Log::info("EldoradoRobuxPriceSentryJob: no alert sent");
}
}
private function textToFloat(string $text): float
{
return floatval(str_replace(["", ","], ["", "."], trim($text)));
}
}

View File

@@ -209,7 +209,7 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
// JobRun
// Get the elements text containing class starting with giveaway-entity-prize__
$prizeElement = $browser->driver->findElements(WebDriverBy::xpath('//div[starts-with(@class, "giveaway-entity-prize__")]'));
$prizeElement = $browser->driver->findElements(WebDriverBy::xpath('//div[starts-with(@class, "_giveaway_")]//div[contains(@class, "_main_dv7x6_48")]'));
// Join their text
$prize = "";
foreach ($prizeElement as $element) {

View File

@@ -87,7 +87,7 @@ abstract class InstagramAbstractJob extends BrowserJob implements ShouldBeUnique
AllNotification::send(new JobDebugNotification($this->jobId, "Instagram login failed: Incorrect password."));
// Stop the job run
throw new \Exception("Instagram login failed: Incorrect password.");
} catch (\Exception $e) {
} catch (\Facebook\WebDriver\Exception\TimeoutException $i) {
// Not the expected error, continue
}
@@ -104,7 +104,7 @@ abstract class InstagramAbstractJob extends BrowserJob implements ShouldBeUnique
$popupsTypes = [
['//button[contains(text(), "Allow all cookies")]'], // Allow all cookies
['//button[contains(text(), "Not Now")]', ["Popup Not Now clicked"]], // Not now
['//button[contains(text(), "OK")]', ["Popup Ok clicked"]], // OK
['(//button|//div)[contains(text(), "OK")]', ["Popup Ok clicked"]], // OK
];
foreach ($popupsTypes as $popup) {
@@ -119,9 +119,9 @@ abstract class InstagramAbstractJob extends BrowserJob implements ShouldBeUnique
}
$button->click();
sleep(2);
return; // Exit after clicking the first popup found
//return; // Exit after clicking the first popup found
} catch (\Exception $e) {
// Porbably no popup found, continue
// Probably no popup found, continue
}
}
}

View File

@@ -71,6 +71,8 @@ class InstagramRepostJob extends InstagramAbstractJob implements ShouldBeUniqueU
sleep(2);
$this->signin($browser);
sleep(2);
$this->removePopups($browser);
sleep(2);
$this->repostLatestPosts($browser);
sleep(5);
@@ -449,6 +451,7 @@ Captions must:
4. Encourage engagement relevant to the platform's algorithm (e.g., asking a question related to the joke/scene).
5. Optionally include relevant hashtags at the end (#hashtagsOnly), chosen appropriately for the reel's content or vibe. Use common tags if no specific ones are provided, but avoid overly generic ones unless fitting.
6. If credit information is provided in the input (e.g., `credit: twitteruser`), acknowledge it minimally within the caption text *using only that source*. Do not invent any account handles (`@`) or platform prefixes (`tt/`). Use phrases like \"Credited to...\" or simply insert the credited name if appropriate, but don't force it unless the core concept naturally includes attribution. If no credit is provided, do not mention a specific creator.
7. Be in english.
**Do Not:**
* Start captions with 'This reel...' or similar intros.

View File

@@ -22,8 +22,8 @@
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_STORE" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>

View File

@@ -0,0 +1,54 @@
<?php
namespace Tests\Feature\EldoradoRobuxPriceSentryJob;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use App\Browser\Jobs\EldoradoRobuxPriceSentry\EldoradoRobuxPriceSentryJob;
use ReflectionMethod;
use Tests\TestCase;
class textToFLoatTest extends TestCase
{
private EldoradoRobuxPriceSentryJob $job;
protected function setUp(): void {
parent::setUp();
$this->job = new EldoradoRobuxPriceSentryJob();
}
private function assertTextToFloat($input, $expected) {
$reflection = new ReflectionMethod(EldoradoRobuxPriceSentryJob::class, 'textToFloat');
$reflection->setAccessible(true);
$result = $reflection->invoke($this->job, $input);
$this->assertEquals($expected, $result, "Failed asserting that textToFloat('$input') equals $expected. Got $result instead.");
}
public function test_simple_int(): void
{
$this->assertTextToFloat("10", 10.0);
$this->assertTextToFloat(" 42", 42.0);
}
public function test_decimal_numbers(): void
{
$this->assertTextToFloat("3,14", 3.14);
$this->assertTextToFloat(" 0,0015 ", 0.0015);
}
public function test_money_symbols_int(): void
{
$this->assertTextToFloat("5 ", 5.0);
$this->assertTextToFloat(" € 123 ", 123.0);
}
public function test_money_symbols_decimal(): void
{
$this->assertTextToFloat("7,89 ", 7.89);
$this->assertTextToFloat(" € 0,75 ", 0.75);
$this->assertTextToFloat(" €0.00402 ", 0.00402);
$this->assertTextToFloat(" 0,00429 ", 0.00429);
}
}

0
tests/Unit/.gitkeep Normal file
View File

View File

@@ -0,0 +1,13 @@
# Selenium Undetected Standalone-Chromedriver
Selenium Standalone-Chromedriver with Undected-Chromedriver applied
## Bug
```txt
Could not start a new session. Response code 500. Message: session not created: probably user data directory is already in use,
```
Go into the `/home/seluser` director in the container and run `rm -rf ~/.config/google-chrome/Singleton*`
If it doesn't work, the log can be found in the set profile folder in the file `chrome_debug.log`