Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

categories in the feed aren't added as hashtags to the toot #11

Closed
steinarb opened this issue Jun 9, 2020 · 3 comments
Closed

categories in the feed aren't added as hashtags to the toot #11

steinarb opened this issue Jun 9, 2020 · 3 comments

Comments

@steinarb
Copy link
Contributor

steinarb commented Jun 9, 2020

Platform: amd64, debian 10.4 "buster", feediverse-0.0.11, feediverse-0.0.11 feedparser-5.2.1 mastodon.py-1.5.1, python 3.7.3

I have this feed that I'm trying to use feediverse to add to mastodon: https://steinar.bang.priv.no/feed/atom/

The feediverse code tries to add the categories as hashtags https://github.com/edsu/feediverse/blob/master/feediverse.py#L66

But as far as I can tell, the hashtags aren't appearing in mastodon.

Here's a toot created by feediverse: https://mastodon.social/@steinarb/104291594180415614

The toot should have had the hashtags "#apachekaraf, #javaprogramming, #declarativeservices, #derby, #jdbc, #karaf, #liquibase, #osgi, #osgiservices, #paxjdbc, #paxjdbcconfig, #postgresql".

But if the hashtags are present in the toot, I can't see them or find them.

@steinarb
Copy link
Contributor Author

The code in https://github.com/edsu/feediverse/blob/master/feediverse.py#L66 prepends a "#" to each tag, and joins the tags space separated into a string value, put in the field hashtags.

As far as I can tell, the mastodon REST API will just drop the hashtags value on the floor: (there is no field hashtags in the body of the POST to /api/v1/statuses : https://docs.joinmastodon.org/methods/statuses/

@steinarb
Copy link
Contributor Author

Hm... that was a wrong conclusion.

The entry returned by get_item is formatted into a string here
https://github.com/edsu/feediverse/blob/master/feediverse.py#L28

The formatted string is sent as argument "status" to Mastodon.status_post() https://github.com/halcy/Mastodon.py/blob/master/mastodon/Mastodon.py#L1648

And the feed['template'] was default '{title} {url}' which I've now changed to {title} {hashtags} {url}'.

We'll see if that makes a difference?

@steinarb
Copy link
Contributor Author

Adding '{hashtags}' to the template caused the hashtags to appear in the toots.

Not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant