The same thing happened yesterday while creating @remindMe. I was just making stupid mistakes, as one does when working with remote APIs and going deeper into returned dictionaries.
For this reason, I've started typing up the entire #MastoBot, which would allow you to create bots at an improved and more reliable and maintainable rate.
I sometimes just love #regex!
I am busy with testing for my next #MastoBot implementation, for a remindMe bot idea.
The main idea is to allow users to mention it and say `@botAccount 2 weeks 3 days 2 hours 5 minutes`, which would then in turn message them, reminding them of the post which they replied to with this comment.
Such functionality can sometimes be difficult, and regex gets its hate for speed, complexity and readibility. But this just works great in #Python for a problem like this.
Here is the #Gist of an early prototype and example for those interested!
https://gist.github.com/e-dreyer/ce0f5e8c51d6454f91901f78f9e04b77
#regex #mastobot #python #gist
I don't find #Qt for #Python very attractive. It is an old style, and the file based config of pages, all though semi-intuative for an experienced code, can be tedious and less eeadable than a standard #HTML page.
My question is, is #Electronon seen is being still very slow, and would it be a good choice for a front-end local app? Should I even go this route, or should I maybe just go with #Djano for the front end and #flask for the backend?
I would like to give a front-end side for my #MastoBot vots I am writing, which would allow users to easily see metrics and interact with the bot if they choose not to write any custom code.
Of course, it would be preferable for it to be OS agnostic, but it will akyway run in #Docker due to the database running in a docker compose.
#qt #python #html #electronon #djano #flask #mastobot #docker #programming #webdev #appdev #opensource
In the real world, there is a theory that you are only 7 minutes away from Leonard Dicaprio or that any actor has played in a movie indirectly with Kevin Bacon.
My hypothesis is that you are all ways 2 or 3 people away from @atomicpoet
This data would be useful to see how #Mastodon is spread out and maybe shown accounts all your followers follow or people in your circle follows, which you never knew existed .
Naturally I would use #MastoBot, which is running @3dprinting andb @Python so it will server as a POC to see if the class is generic enough as well as allow for the development system which can handle failed requests and get back to it again.
Ok, so I am just taking a break from @3dprinting and @Python for a week. They are now stable, and I am just waiting for some corner casebto crash and break it.
So what is my next challenge, you ask? Aaha, we are going to construct the social graph of Mastoson. Starting with my account, I am going to get all accounts that I follow as well as my followers and will then add them to a stack.
For every account, I will store their ID and instance domain.
From this, I will start doing a breadth-first-search, just because a depth search could go on forever without getting a usuable result.
In order to achieve this, I'll be using #Python and #Redis for insane read and write speeds. I will also combine 3 or 4 accounts to get 4 API keys to bypass rate limits and to determine how to implement multi-bot in #MastoBot. I will also be doing pure webscraping. This will happen over a week or a month.
My hope is to construct something like this to see how my local communities are interconnected.
Asyncio, however, will only allow Python to hand over control if it is waiting for output when we use the "await" keyword.
Because we have large functions with single lines that take long, asynio is a better choice here because we don't want something to freeze if it could actually run to completion.
Asyncio also allows us to mix blocking and not blocking functions more easily.
Thus, #MastoBot and @Python will need to be changed. Ideally, the periodic checks should be done with an async sleep function. During this time, the rest of the code can run. Then, we can have asyncs for all the new posts received. Finally, they can be posted.
All while this happens, the other part of the code can process mentions and followers.
Threads: https://realpython.com/intro-to-python-threading/
Async: https://realpython.com/async-io-python/
How I will be doing this split is still under investigation.
#mastobot #python #programming
#Python threading, asyncio, and multi-processing
Recently, as I've worked on #MastoBot, I have enountered many situations where my code waits, takes a long time to execute, and my main loop is blocked.
With my @3dprinting bot, this only happens on the first run of a clean config, where all previous posts are fetched from the #Mastodon API and stored in a #Redis database The reason is irrelevant, but basically for metrics.
Thus, when the bot starts, it makes about 1.3k requests, one for every post by the bot. This can take about 10 minutes, with the API, paging, network speed, and rate limiting.
During this time, no mentions, new followers, or any other notifications are processed. Then BAM! Everything goes through, and WOW, we are back on track.
#python #mastobot #Mastodon #Redis #programming
I did it again!
So I created #MastoBot, a generic #Python Mastodon bot that allows anyone to create a bot.
I created a few versions, and I use it for @3dprinting. But naturally, knowing how to implement it and developing functions, I need a use case.
So after a discussion this morning. I spent the entire day writing @Python. Yes, I did it again.
However, this one now has a built-in #webscraper to cross-post new posts fromhttps://discuss.python.org/, because why not.
This @Python required a few things, and updates were made to #MastoBot. I had to make it even more generic, implement an overkil datastore with #Redis, and extend the config system.
@Python will behave exactly like @3dprinting with the added feature of crossposts. These posts will, however, be "follower only" posts, to not polute #Python and just flood everything initially.
The bot will #boost parent posts, allowing for threads and discussions to be created.
The source code will be out tomorrow, just cleaning up.
#mastobot #python #Webscraper #Redis #boost
I wrote it myself. The #Github links were posted a week or so ago but is currently set to private as I changed the name from Mastodon-group-bot to #MastoBot as it now has more generic functionality and is also a Python package.
It is written in #Python, #Docker, and also uses #Sqlite, but this is currently being changed to possibly use #Redis, but I am still experimenting.
I'll let you know once the repo is public again, and you can check out the source code.
The source code for this bot's config and the package will be back online in a day or two.
#github #mastobot #python #docker #sqlite #Redis
Does anybody know what's the easiest way to create a bot for Mastodon?
#bot #mastodonbot #mastodonbots #mastobot #mastobots
#mastobots #mastobot #mastodonbots #mastodonbot #bot
Looking to bring an RSS or ATOM feed into the #Fediverse? I posted some source code for a quick-and-dirty utility to do this in #Python here (could use some enhancements, but it's a good basic core of a feed poster) #software #RSS #ATOM #bot #MastoBot : https://github.com/ai6yr/rss2mastodon
#Fediverse #python #software #rss #atom #bot #mastobot
Ik kan je bericht niet meer vinden op je FAQ bot, maar volgens mij is dit een #python library die je zoekt (op basis van de readme in ieder geval): https://pypi.org/project/mastobot/
> Use Mastobot when:
> Your bot replies to or interacts with certain posts on its home timeline; or
>Your bot answers some questions people ask it; or
> Your bot keeps track of some users it's following.
#mastobot
This week's #FollowFriday / #FavoriteFollows list - #DarkSkies / #Astronomy / #Astronomers / #Space
@rdrimmel
#Astronomer from #Montana, Mapper of the #MilkyWay, @IDADarkSky(on Twitter)
advocate, #GaiaMission Expert, fan of #scicomm, #MadeInItaly, #CitizenScience & #DarkSkiesForAll
@marwellaspaceart
Amateur #SpaceArtist, love astronomy and #astrophotography
@mondinspace
#Space, science and wonder. Personal account. Views and opinions my own.
@sundogplanets
Professor of astronomy, farmer of goats. #Asteroid (42910). She/her. Settler living on Treaty 4 lands (Saskatchewan).
@JohnBarentine
Astronomer. Historian. Author. Small business owner. Arizona native. Proud LGBT American. Retiring to asteroid 14505. Questioning everything; occasionally getting in trouble for it.
@starrytimepod
Sisters Jordan and Kit cohost this monthly #podcast featuring #astronomy, ret-cons(tellations) of #mythology, and fun.
{Bot) Universe at your fingertips, every hour!
NASA Jet Propulsion Laboratory's (JPL) unofficial Photoblog.
#bot #mastobot #astronomy #galaxy #photography #information #nasa #jpl
#followfriday #favoritefollows #darkskies #astronomy #astronomers #space #Astronomer #montana #milkyway #gaiamission #scicomm #madeinitaly #citizenscience #darkskiesforall #spaceartist #astrophotography #asteroid #Podcast #mythology #bot #mastobot #galaxy #photography #information #NASA #jpl
#techbot už není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy z #technologie tedy můžete sledovat na následujících účtech:
@Deep_in_IT_cz
@lsaeu
@MobilManiacz
@operatorivcr
@Rootcz
@smartmania
#techbot #technologie #mastobot #zpravobot
#techbot už taky není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy z #technologie tedy můžete sledovat na následujících účtech:
@Deep_in_IT_cz
@lsaeu
@MobilManiacz
@operatorivcr
@Rootcz
@smartmania
#techbot #technologie #mastobot #zpravobot
#techbot už taky není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy z #technologie tedy můžete sledovat na následujících účtech:
@Deep_in_IT_cz
@lsaeu
@MobilManiacz
@operatorivcr
@Rootcz
@smartmania
#techbot #technologie #mastobot #zpravobot
#kulturobot už není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy z #kultura tedy můžete sledovat na následujících účtech:
@EDNA_cz
@iliteraturacz
@kinobox_cz
@Kultura21_cz
@narodnigalerie
@narodniknihovna
@narodnimuzeum
@totalfilmweb
#kulturobot #kultura #mastobot #zpravobot
#sportbot už není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy a informace tedy můžete sledovat na následujících účtech:
@DenikSport
@iDNEScz_Sport
@LivesportCZ
@sportCT
@sportcz
@F1onlinesk
@GPF1cz
#sportbot #mastobot #zpravobot
#Meteobot už není jeden samostatný účet, ale skupina několika účtů. Zajímavé zprávy a data tedy můžete sledovat na následujících účtech:
@AgroriskC
@CHMUCHMI
@CHMU_hydrologie
@vystrahy
@Intersucho
@SUJBofficial
#meteobot #mastobot #Zprávobot