Mastodon bot RSS plugin: Additional RSS entry elements #236
Labels
No labels
architecture
authentication
backend
bug
ci/cd
cleanup
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
media
mobile
new feature
notes
packaging
question
ui
voice
waiting user input
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: platypush/platypush#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
thank you for your excellent post on Mastodon and the related work and guide to run a bot via Platypush and it's RSS plugin. (Side question: If I may ask, is the example code of your blog post also under an MIT license?). I adapted your Mastodon bot code, enhanced it to my needs and it works fine.
Although, I have a feature request which has also been raised in issue #233. I want to add further elements from a RSS feed entry to my Mastodon toots, especially the 'author' and the 'tags' element. I already got it working in a standalone python script using the feedparser library but ultimately could not get it working by modifying the platypush pip package, it always ended up with "'NewFeedEntryEvent' object has no attribute 'author'"
I would appreciate if you could add these two elements officially, as you stated that you could add this via PR quite quickly.
(NO NEED TO READ FURTHER:) Below is to just to document my failed attempt to add parsing the 'author' element to the Platypush RSS plugin:
Installed platypush with editable parameter (to edit rss plugin in real-time).
Edited platypush/platypush/plugins/rss/init.py to add 'author' element.
Edited platypush/platypush/backend/http/request/rss/init.py to add 'author' element.
So, unfortunately my changes didn't work, but as you see I tried ;)
Forgot to mention: I really enjoyed reading your take on Fediverse history in that blog post also, really nice essay, learned a lot from it :)
All the samples are released under MIT license as well. In hindsight I would have preferred to release both Platypush and any sample code under GPL3, but since it's hard to change licensing once things have started I'd rather keep consistency.
About the
author
andtags
fields, they are quite straightforward to add (your solution was close, you just missed adding them to theNewFeedEntryEvent
object as well).The only problem is that adding columns to an existing SQLAlchemy model without asking people to remove and re-create their database requires migration scripts - i.e. Alembic in the Python world. So far I've tried to kick that can down the road as long as I could, but since migration scripts will also be useful for the new large feature I'm working on (support for the persistence of generic entities) I'd rather pull this tooth now rather than later.If I have a bit of time I should be able to merge a PR over this weekend.p.s. Nevermind the part about Alembic and database migrations, we won't need it (at least not for this case). The code you found for the
FeedEntry
table actually is only used inbackend.http.request.rss
, which is a deprecated backend largely replaced by therss
plugin (one of the reasons is exactly that it was storing each single feed entry on a table for no good reason, and that table may have been hard to extend in the future). So adding the fields just to the event is more than enough to get things to work, since therss
plugin, unlike the previous implementation, is stateless. That should considerably speed up the implementation time.