Ricompense di Bidoo e campanella come seconda fonte del riscatto (#38)
Il bot riscattava i collegamenti di puntateaste.it ma non sapeva se Bidoo li avesse accreditati davvero, e perdeva i collegamenti che arrivano solo nella campanella del sito. - A intervalli (FreeBidsRewardsHours, 6 ore, 0 = mai) legge /my_chests.php e la prima pagina di /bids_history.php, salva le ricompense nuove in account_rewards (migrazione 0006, chiave unica, solo inserimenti) e scrive nel registro se i conti del giorno con i riscatti del bot tornano. - La campanella /checkN.php diventa seconda fonte (FreeBidsUseNotifications): solo la lettura semplice, mai _d o _r, cosi' le notifiche restano non lette. - Pagina Puntate gratis: scheda «Ricompense di Bidoo» e ora dell'ultima lettura. - La tabella entra nello scaricamento dei dati; test con copie della struttura vera delle due pagine e della campanella, valori inventati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88c16568fb
commit
6cbc5e58b0
22 files changed
+590
-12
No files matched your search
@@ -0,0 +1 @@
|
||||
{"count":3,"elements":{"0":{"id":"9000003","users":"0","type":"9","arguments":"","created_at":"1795511000","visibleFor":"0","readFlag":"0","content":"<a href=\"https:\/\/it.bidoo.com\/?promocode=prova241126&sign=0123456789abcdef0123456789abcdef01234567\" target=\"_blank\"><p class=\"paragraph-notification\">Solo per oggi: 5 puntate gratis per te!<\/p><\/a>"},"1":{"id":"9000002","users":"0","type":"6","arguments":"","created_at":"1795470000","visibleFor":"0","readFlag":"1","content":"<a href=\"https:\/\/it.bidoo.com\/shop\/credits_history\" target=\"_blank\"><img class=\"wallet-icon\" src=\"https:\/\/static-cdn.bidoo.com\/res\/1.0\/images\/wallet.svg\">\n <p class=\"paragraph-notification\">Sul tuo conto Bidoo Shop è stato accreditato l'importo di 10.00 €<\/p><\/a>"},"2":{"id":"9000001","users":"0","type":"9","arguments":"","created_at":"1795400000","visibleFor":"0","readFlag":"2","content":"<p class=\"paragraph-notification\">Copia questo indirizzo: https:\/\/it.bidoo.com\/index.php?promocode=altro241126&sign=89abcdef0123456789abcdef0123456789abcdef<\/p>"}},"audio":"","exceed":22,"shexc":22,"t":1795541810}
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Copia ridotta della struttura di /bids_history.php (24/11/2026), valori inventati: nessun dato personale. -->
|
||||
<html lang="it">
|
||||
<head><title>My Bidoo - Cronologia Crediti - Bidoo</title></head>
|
||||
<body>
|
||||
<table class="table table-striped my-bidoo-table">
|
||||
<thead><tr><th>Data</th><th>Descrizione</th><th>Prezzo</th><th class="hidden-xs">Metodo di Pagamento</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="date"> <div id="data_mov1000000003" class="text-dark menu_my_datime_box"></div> <div id="ora_mov1000000003" class="menu_my_datime_box"></div> </td>
|
||||
<td class="text-dark desc"> <div class="descr"><span class="first_row_desc">5 <i class="bi bi-single-money"></i> Gratis</span><div class="second_row_desc truncate_text"> </div> <span class="isGainedWithBonus"></span> </div> </td>
|
||||
<td class="text-dark tot"><b class="text-green">Gratis</b></td>
|
||||
<td class="hidden-xs"><b class="text-green">Gratis</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="date"> <div id="data_mov1000000002" class="text-dark menu_my_datime_box"></div> <div id="ora_mov1000000002" class="menu_my_datime_box"></div> </td>
|
||||
<td class="text-dark desc"> <div class="descr"><span class="first_row_desc">2 <i class="bi bi-single-money"></i> Gratis</span><div class="second_row_desc truncate_text"> </div> <span class="isGainedWithBonus"></span> </div> </td>
|
||||
<td class="text-dark tot"><b class="text-green">Gratis</b></td>
|
||||
<td class="hidden-xs"><b class="text-green">Gratis</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="date"> <div id="data_mov1000000001" class="text-dark menu_my_datime_box"></div> <div id="ora_mov1000000001" class="menu_my_datime_box"></div> </td>
|
||||
<td class="text-dark desc"> <div class="descr"><span class="first_row_desc">1.000 <i class="bi bi-single-money"></i> Puntate</span><div class="second_row_desc truncate_text"> Pacchetto </div> <span class="isGainedWithBonus"></span> </div> </td>
|
||||
<td class="text-dark tot"><b>100,00 €</b></td>
|
||||
<td class="hidden-xs"><b>Carta</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="date"> <div id="data_mov1000000000" class="text-dark menu_my_datime_box"></div> </td>
|
||||
<td class="text-dark desc"> <div class="descr"><span class="first_row_desc">3 <i class="bi bi-single-money"></i> Gratis</span></div> </td>
|
||||
<td class="text-dark tot"><b class="text-green">Gratis</b></td>
|
||||
<td class="hidden-xs"><b class="text-green">Gratis</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="pagination-wrap"><a class="pagination_active" href="/bids_history.php?page=1">1</a> <a class="pagination" href="/bids_history.php?page=2">2</a></div>
|
||||
<script>
|
||||
if (MM_findObj('data_mov' + 1000000003)) { sIDdatemov = 'data_mov' + 1000000003; msIDdatemov = 'mdata_mov' + 1000000003; sValuedatemov = formattaDataStorico(1795511512, 'it'); $('#'+sIDdatemov).html(sValuedatemov); $('#'+msIDdatemov).html('<b>'+sValuedatemov+'</b>'); } if (MM_findObj('ora_mov' + 1000000003)) { sIDoramov = 'ora_mov' + 1000000003; sValueoramov = formattaOraStorico(1795511512); }
|
||||
if (MM_findObj('data_mov' + 1000000002)) { sIDdatemov = 'data_mov' + 1000000002; msIDdatemov = 'mdata_mov' + 1000000002; sValuedatemov = formattaDataStorico(1795473185, 'it'); $('#'+sIDdatemov).html(sValuedatemov); } if (MM_findObj('ora_mov' + 1000000002)) { sValueoramov = formattaOraStorico(1795473185); }
|
||||
if (MM_findObj('data_mov' + 1000000001)) { sIDdatemov = 'data_mov' + 1000000001; msIDdatemov = 'mdata_mov' + 1000000001; sValuedatemov = formattaDataStorico(1790000000, 'it'); $('#'+sIDdatemov).html(sValuedatemov); }
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Copia ridotta della struttura di /my_chests.php (24/11/2026), valori inventati: nessun dato personale. -->
|
||||
<html lang="it">
|
||||
<head><title>My Bidoo - Le mie ricompense - Bidoo</title></head>
|
||||
<body data-lang="it" class="page-award">
|
||||
<div class="wrap-bonus-section">
|
||||
<a href="javascript:void(0)" class="chest-opened-collapse"> <div class="title-award">Cronologia <i class="fa fa-angle-down " aria-hidden="true"></i></div> </a>
|
||||
<div class="wrap-items-opened collapse">
|
||||
<div class="items-sections-opened">
|
||||
<div class="wrap-item " data-is_expire="1" data-is_opened="1">
|
||||
<div class="pt5"> <img src="https://static-cdn.bidoo.com/res/1.0/images/chest_opened_static.png" class="img-chest"> </div>
|
||||
<div class="pt5">
|
||||
<div class="text">Ottenuto tramite link il 24 Novembre 2026 alle 09:05</div>
|
||||
<div class="pt-chest"><b>+5</b> <img src="https://static-cdn.bidoo.com/res/1.0/images/bids1.svg" class="coin"> <b>Puntate</b></div>
|
||||
<!-- <div class="used">--><!--</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-item " data-is_expire="1" data-is_opened="1">
|
||||
<div class="pt5"> <img src="https://static-cdn.bidoo.com/res/1.0/images/chest_opened_static.png" class="img-chest"> </div>
|
||||
<div class="pt5">
|
||||
<div class="text">Ottenuto tramite link il 24 Novembre 2026 alle 09:05</div>
|
||||
<div class="pt-chest"><b>+5</b> <img src="https://static-cdn.bidoo.com/res/1.0/images/bids1.svg" class="coin"> <b>Puntate</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-item " data-is_expire="1" data-is_opened="1">
|
||||
<div class="pt5"> <img src="https://static-cdn.bidoo.com/res/1.0/images/chest_opened_static.png" class="img-chest"> </div>
|
||||
<div class="pt5">
|
||||
<div class="text">Ottenuto tramite link il 23 Novembre 2026 alle 21:40</div>
|
||||
<div class="pt-chest"><b>+2</b> <img src="https://static-cdn.bidoo.com/res/1.0/images/bids1.svg" class="coin"> <b>Puntate</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-item " data-is_expire="1" data-is_opened="1">
|
||||
<div class="pt5"> <img src="https://static-cdn.bidoo.com/res/1.0/images/chest_opened_static.png" class="img-chest"> </div>
|
||||
<div class="pt5">
|
||||
<div class="text">Ottenuto tramite aste di puntate confermate il 3 Novembre 2026 alle 18:12</div>
|
||||
<div class="pt-chest"><b>+15</b> <img src="https://static-cdn.bidoo.com/res/1.0/images/bids1.svg" class="coin"> <b>Puntate</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-item " data-is_expire="1">
|
||||
<div class="pt5"> <img src="https://static-cdn.bidoo.com/res/1.0/images/chest_closed_static.png" class="img-chest"> </div>
|
||||
<div class="pt5">
|
||||
<div class="text">Dal forziere del 2 Novembre 2026 10:30</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,99 @@
|
||||
using Mimante.Bidoo;
|
||||
using Mimante.Bidoo.FreeBids;
|
||||
using Xunit;
|
||||
|
||||
namespace Mimante.Tests;
|
||||
|
||||
/// <summary>Ricompense, cronologia crediti e campanella di Bidoo (#38): copie della struttura vera, valori inventati.</summary>
|
||||
public class RewardsPagesTests
|
||||
{
|
||||
private static readonly TimeZoneInfo Rome = TimeZoneInfo.FindSystemTimeZoneById("Europe/Rome");
|
||||
|
||||
private static string Fixture(string name) => File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "Fixtures", name));
|
||||
|
||||
[Fact]
|
||||
public void I_forzieri_aperti_con_data_fonte_e_premio()
|
||||
{
|
||||
var read = RewardsPages.ParseChests(Fixture("ricompense-forzieri.html"), Rome);
|
||||
Assert.Null(read.Error);
|
||||
Assert.Equal(4, read.Items.Count); // quello senza premio non conta
|
||||
|
||||
var first = read.Items[0];
|
||||
Assert.Equal(RewardsPages.KindChest, first.Kind);
|
||||
Assert.Equal(new DateTime(2026, 11, 24, 8, 5, 0, DateTimeKind.Utc), first.AtUtc); // 09:05 a Roma
|
||||
Assert.Equal(5, first.Bids);
|
||||
Assert.True(first.Free);
|
||||
Assert.Equal("link", first.Source);
|
||||
Assert.Contains("+5 Puntate", first.Description);
|
||||
|
||||
// Due forzieri uguali nello stesso minuto restano due.
|
||||
Assert.NotEqual(read.Items[0].Key, read.Items[1].Key);
|
||||
Assert.Equal(read.Items.Count, read.Items.Select(i => i.Key).Distinct().Count());
|
||||
|
||||
Assert.Equal("aste di puntate confermate", read.Items[3].Source);
|
||||
Assert.Equal(15, read.Items[3].Bids);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void La_cronologia_crediti_prende_l_ora_dallo_script_della_pagina()
|
||||
{
|
||||
var read = RewardsPages.ParseCreditHistory(Fixture("cronologia-crediti.html"));
|
||||
Assert.Null(read.Error);
|
||||
Assert.Equal(3, read.Items.Count);
|
||||
Assert.Equal(1, read.Skipped); // il movimento senza ora nello script
|
||||
|
||||
var free = read.Items[0];
|
||||
Assert.Equal("accredito|1000000003", free.Key);
|
||||
Assert.Equal(DateTimeOffset.FromUnixTimeSeconds(1795511512).UtcDateTime, free.AtUtc);
|
||||
Assert.Equal(5, free.Bids);
|
||||
Assert.True(free.Free);
|
||||
|
||||
var paid = read.Items[2];
|
||||
Assert.Equal(1000, paid.Bids);
|
||||
Assert.False(paid.Free);
|
||||
Assert.Contains("Pacchetto", paid.Description);
|
||||
Assert.Contains("100,00 €", paid.Description);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void La_campanella_da_solo_i_collegamenti_promozionali_e_passano_il_controllo()
|
||||
{
|
||||
var bell = RewardsPages.ParseNotifications(Fixture("campanella.json"));
|
||||
Assert.Null(bell.Error);
|
||||
Assert.Equal(3, bell.Notifications);
|
||||
Assert.Equal(2, bell.Links.Count);
|
||||
Assert.Equal("9000003", bell.Links[0].Id);
|
||||
Assert.Equal("https://it.bidoo.com/?promocode=prova241126&sign=0123456789abcdef0123456789abcdef01234567", bell.Links[0].Href);
|
||||
Assert.Equal("9000001", bell.Links[1].Id); // indirizzo scritto nel testo, senza href
|
||||
|
||||
var fb = BidooReferences.Default.FreeBids;
|
||||
foreach (var (_, href) in bell.Links)
|
||||
Assert.True(PromoLinkCheck.Check(href, BidooReferences.Default.Host, fb.PromoPaths, fb.PromoExtraParameters).Ok, href);
|
||||
|
||||
Assert.Empty(RewardsPages.ParseNotifications("""{"count":0,"elements":[],"t":1}""").Links);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Una_pagina_di_accesso_o_una_risposta_rotta_si_dicono_e_non_danno_ricompense()
|
||||
{
|
||||
const string login = "<html><body><form action=\"/login.php\"><input name=\"password\"></form></body></html>";
|
||||
Assert.NotNull(RewardsPages.ParseChests(login, Rome).Error);
|
||||
Assert.NotNull(RewardsPages.ParseCreditHistory(login).Error);
|
||||
Assert.NotNull(RewardsPages.ParseChests(null, Rome).Error);
|
||||
Assert.NotNull(RewardsPages.ParseNotifications(login).Error);
|
||||
Assert.NotNull(RewardsPages.ParseNotifications("""{"count":0}""").Error);
|
||||
Assert.Empty(RewardsPages.ParseNotifications("rotto").Links);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Il_confronto_del_giorno_con_i_riscatti_del_bot()
|
||||
{
|
||||
var items = RewardsPages.ParseChests(Fixture("ricompense-forzieri.html"), Rome).Items;
|
||||
var today = new DateOnly(2026, 11, 24);
|
||||
Assert.EndsWith("tornano", RewardsPages.CompareToday(items, today, Rome, 2, 10));
|
||||
Assert.Contains("2 ricompense da collegamento (+10 puntate)", RewardsPages.CompareToday(items, today, Rome, 2, 10));
|
||||
Assert.Contains("fuori dal bot", RewardsPages.CompareToday(items, today, Rome, 1, 5));
|
||||
Assert.Contains("non compare", RewardsPages.CompareToday(items, today, Rome, 3, 15));
|
||||
Assert.Contains("1 ricompense da collegamento (+2 puntate)", RewardsPages.CompareToday(items, today.AddDays(-1), Rome, 1, 2));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user