La versione italiana si trova sotto quella inglese
The italian version is under the english one
The "Megaptera-marina" project is one of two I'm still actively working on, even though the script is already fully operational and doing exactly what I wanted it to do — the other is SplinterROI, the small site I built to track rental ROI for Splinterlands cards.
Although the @megaptera-marina account is doing exactly what it's supposed to — that is, reblogging the posts of all participants in the #untobisunto contest to make them easily visible to anyone following the account — I’d still like to gradually make the project more complete and feature-rich over time.
This isn’t so much because I think it needs it — after all, the useful part is the post reblog — but because enhancing something I’ve built with Python is a great way for me to practice: adding new features means making a script more complex and harder to maintain, which is something I’m currently not used to at all.
With Megaptera-marina — and SplinterROI — I’d like to take on this challenge and see if, over time, I can keep adding new functionality without "breaking" everything.
And in this spirit, I made a small change yesterday to the behavior of @megaptera-marina.
One of @megaptera-marina’s features is to leave a small comment under each post, both to let the author know that their entry includes the correct tag, and to remind them that they can check out and support other participants' posts.
The comment is a fixed message, with some parts filled in by the script using the author’s details.
Or at least — it was until today!
As you can see, @maruskina was the first author to receive a slightly different comment than before: the change is small, but I think it’s enough to make @megaptera-marina’s interaction a bit more varied and less repetitive.
There are now 10 different comments available, and the script randomly selects one each time it runs.
class Config:
def __init__(self):
# Get credentials from Secrets
key = os.getenv("POSTING_KEY")
if not key:
raise ValueError("POSTING_KEY not found")
self.hive = Hive(keys=[key])
self.account = "megaptera-marina"
self.weight = 1.0
templates = [
"comment_0.template",
"comment_1.template",
"comment_2.template",
"comment_3.template",
"comment_4.template",
"comment_5.template",
"comment_6.template",
"comment_7.template",
"comment_8.template",
"comment_9.template"
]
chosen_template = random.choice(templates)
self.body_template = self.load_template(chosen_template)
def load_template(self, filename):
template_path = os.path.join("templates", filename)
with open(template_path, "r", encoding="utf-8") as file:
return jinja2.Template(file.read())
def render_body(self, target_account, author_account):
return self.body_template.render(
target_account=target_account, author_account=author_account
)
Of course, more templates could be added or made more creative, but for now the idea was just to implement the logic — later on, depending on user feedback, I’ll decide whether to spice up the messages a bit more or increase their number so that it’s rarer to see the same one multiple times.
Not only that — this feature could even be used for other purposes, like inserting a special, rare comment that, when triggered, guarantees a prize for the users who receive it.
I remember that @fedesox a while ago made a small addition to the “Unto & Bisunto” contest, allowing participants to earn an extra reward by using the #Tipzz tag — this is the post.
I don’t know how many participants have noticed or taken advantage of this option so far, but thanks to @megaptera-marina, it would now be possible to introduce a different way to earn that prize — or at the very least, help promote it a bit more.
This is just one concrete example meant to show how even small changes or additions can open the door to possibilities that would otherwise be completely out of reach — and that’s one of the reasons I love programming! :)
cover image made with Grok AI
to support the #OliodiBalena community, @balaenoptera is 3% beneficiary of this post
If you've read this far, thank you! If you want to leave an upvote, a reblog, a follow, a comment... well, any sign of life is really much appreciated!
Versione italiana
Italian version
Il progetto "Megaptera-marina" è uno dei due a cui sto attualmente continuando a lavorare nonostante lo script sia completamente operativo e faccia già quel che volevo facesse - l'altro è SplinterROI, il piccolo sito che ho creato per scoprire il ROI da noleggio delle carte di Splinterlands.
Anche se l'account @megaptera-marina sta facendo esattamente ciò che deve, ossia ribloggare i post di tutti i partecipanti al contest #untobisunto, così da renderli facilmente visibili a chiunque segua l'account, vorrei infatti provare nel tempo a rendere il progetto sempre più completo e ricco di funzionalità.
Questo non tanto perchè credo che ce ne sia bisogno - alla fine la cosa utile è il reblog dei post - quanto perchè arricchire qualcosa che ho creato con python è un ottimo modo per esercitarmi: aggiungere nuove funzionalità significa infatti rendere uno script sempre più complesso e complicato da gestire, cosa che io attualmente non sono minimamente abituato a fare.
Con Megaptera-marina - e SplinterROI - vorrei perciò provare ad affrontare questa sfida e vedere se nel tempo riesco ad inserire nuove funzionalità senza "rompere" tutto.
E proprio in quest'ottica ho apportato ieri una piccola modifica al comportamento di @megaptera-marina.
Tra le funzioni di @megaptera-marina c'è infatti quella di lasciare un piccolo commento sotto ogni post, così da avvisare l'autore sia che la sua entry contiene il tag corretto, ma anche ricordargli/le che può passare a leggere e supportare i post degli altri partecipanti.
Il commento è un testo fisso integrato dallo script con i dati dell'autore.
O così era sino ad oggi!
Come potete vedere, @maruskina è stata infatti la prima autrice a ricevere un commento un po' diverso dai precedenti: la differenza è piccola, ma penso sia sufficiente a rendere un po' più varia e meno ripetitiva l'interazione di @megaptera-marina.
I commenti a disposizione del progetto sono adesso 10, con uno diverso che viene estratto a sorte ad ogni attivazione dello script.
class Config:
def __init__(self):
# Get credentias from Secrets
key = os.getenv("POSTING_KEY")
if not key:
raise ValueError("POSTING_KEY not found")
self.hive = Hive(keys=[key])
self.account = "megaptera-marina"
self.weight = 1.0
templates = [
"comment_0.template",
"comment_1.template",
"comment_2.template",
"comment_3.template",
"comment_4.template",
"comment_5.template",
"comment_6.template",
"comment_7.template",
"comment_8.template",
"comment_9.template"
]
chosen_template = random.choice(templates)
self.body_template = self.load_template(chosen_template)
def load_template(self, filename):
template_path = os.path.join("templates", filename)
with open(template_path, "r", encoding="utf-8") as file:
return jinja2.Template(file.read())
def render_body(self, target_account, author_account):
return self.body_template.render(
target_account=target_account, author_account=author_account
)
Ovviamente è possibile aggiungerne di più o renderli più vari, ma per ora l'idea era quella di implementare la logica, poi un domani valuterò - anche in seguito all'eventuale feedback dei partecipanti - se usare un po' più di fantasia nel comporre i messaggi o se aumentarne il numero così da rendere più raro ricevere più volte lo stesso.
Non solo, volendo questa funzione potrebbe essere sfruttata anche per altri scopi, come ad esempio inserire un commento speciale e molto raro che, quando estratto, assicuri un premio agli utenti che lo hanno ricevuto.
Mi ricordo infatti che @fedesox qualche tempo fa aveva fatto una piccola aggiunta al contest "Unto & Bisunto" prevedendo la possibilità di ottenere un premio extra usando il tag #Tipzz - questo è il post.
Non so ad oggi quanti partecipanti si siano accorti di questa possibilità e l'abbiano sfruttata, ma tramite @megaptera-marina sarebbe adesso possibile inserire un diverso modo per ottenere questo premio, o anche solo per pubblicizzarlo un po' di più.
Questo giusto per fornire un esempio concreto e per rendere l'idea di come anche piccole modifiche o aggiunte possano aprire le porte a possibilità prima altrimenti completamente precluse: e questa è una delle ragioni per cui adoro programmare! :)
immagine di cover creata con Grok AI
a supporto della community #OliodiBalena, il 3% delle ricompense di questo post va a @balaenoptera
Se sei arrivato a leggere fin qui, grazie! Se hai voglia di lasciare un upvote, un reblog, un follow, un commento... be', un qualsiasi segnale di vita, in realtà, è molto apprezzato!
Posted Using INLEO
Io lo lascio il segnale di vita, ma senza segnale cerebrale: infatti non ci ho capito una... beata minkia! (come il personaggio di Albanese, e diciamolo 😂). Ma credo tu arriverai a fare una bella cosa.
!LOLZ
lolztoken.com
...then I don't want to know how bad asworstos is.
Credit: reddit
@arc7icwolf, I sent you an $LOLZ on behalf of sissim72
(1/6)
Detto in un po' (molte) meno parole: i commenti di megaptera-marina d'ora in poi saranno leggermente diversi (ci sono 10 testi che si alternano a caso)... e questo volendo un domani potrebbe essere sfruttato anche per implementare qualche ulteriore iniziativa/idea carina, come l'assegnazione di premi casuali!
Probabilmente così è più chiaro, ma volevo scriverci su un post, per cui ho dovuto allungare un po' la spiegazione 🤣🤣🤣
!LOL
lolztoken.com
Because he Neverlands
Credit: reddit
@sissim72, I sent you an $LOLZ on behalf of arc7icwolf
(2/10)
NEW: Join LOLZ's Daily Earn and Burn Contest and win $LOLZ
!PIMP
!PIZZA
!hiqvote
!discovery 30
Grazie Liberty!
!LOL !PIZZA !LUV
lolztoken.com
They eventually fired him.
Credit: reddit
@libertycrypto27, I sent you an $LOLZ on behalf of arc7icwolf
(1/10)
NEW: Join LOLZ's Daily Earn and Burn Contest and win $LOLZ
Poca roba, i problemi principali potrebbero essere legati al prezzo momentaneamente basso di ARRR, alla lunghezza di sincronizzazione dei wallet (minima su lite desktop ma ammetto che su Edge mobile ci vuole una buona mezz’ora), o generalmente alla mia proposta scorretta di partecipazione, pensavo di offrire un token legato ai commenti da bruciare in cambio di ARRR, ma anche a quel punto uno deve per forza fare almeno lo “sforzo” di scaricarsi il wallet per riceverli.
Peccato, perché è la privacy coin più robusta e anonima sul mercato e prima o poi con liquidità esterna ai CEX (si lavora a lungo termine per non dover in alcun modo più usare exchange centralizzati, stesso problema che hanno Zano, Monero e tante altre monete “non conformi ai dictat”), i 14 cent di oggi saranno un lontano ricordo.
Se vuoi provare a ridare un po' di slancio a questa iniziativa, potrei inserire un commento su dieci (o su cinque, venti, cento, come preferisci) che comunica al partecipante al contest di aver vinto "x" token ARRR, invitandolo a scaricare il wallet da un link ed a comunicare successivamente il suo indirizzo tramite un commento ed un tag a @fedesox. Forse se la gente vedesse la scritta "Hai vinto $$$ 🤑" sarebbe più incentivata a provare a scaricare il wallet 🤣
@fedesox ti dirò, inizialmente mi aveva intrigato, ma poi leggendo il post in cui spiegavi di cosa si stava parlando, per me che non capisco un tubo di crypto, non capivo metà delle parole 😅 magari non ha riscosso successo perché molti partecipanti al contest che sono qui solo per scrivere della loro esperienza non sono a proprio agio nell'aprire un altro wallet così tanto per.
Cioè già in questo tuo commento... Edge, sincronizzazione dei wallet, dictat, privacy coin, cex, zano e monero... Mi sembrano cose importanti di cui io non ho la minima idea e questo è sufficiente a farmi desistere perché mi dà la sensazione del "non so in cosa mi sto imbarcando"
This post was shared and voted inside the discord by the curators team of discovery-it
Join our Community and follow our Curation Trail
Discovery-it is also a Witness, vote for us here
Delegate to us for passive income. Check our 80% fee-back Program
$PIZZA slices delivered:
@arc7icwolf(1/10) tipped @libertycrypto27
libertycrypto27 tipped arc7icwolf
Come get MOONed!