jackjamieson2 / yarns-microsub-server

Yarns is a Microsub server that runs as a plugin on your WordPress site.
GNU General Public License v2.0
20 stars 4 forks source link

missing information from jsonfeed #80

Open jackjamieson2 opened 5 years ago

jackjamieson2 commented 5 years ago

e.g. when I parse manton.org/feed.json, the feed author information is not added to items

Looks like this is because the author information is not stored as an h-card like with other feeds

It returns with the author information as properties at the beginning of the feed.

{
  "type": "jsonfeed",
  "name": "Manton Reece",
  "url": "https:\\/\\/www.manton.org\\/feed.json",
  "photo": "https:\\/\\/micro.blog\\/manton\\/avatar.jpg",
  "items": [
...
}

Yarns is expecting an author property as an h-card

"author":{
  "name": "Manton Reece",
  "url": "https:\\/\\/www.manton.org\\/feed.json",
  "photo": "https:\\/\\/micro.blog\\/manton\\/avatar.jpg",
}

Two ways to address this:

1) I can add a bit to Yarns to convert this

2) This could be addressed in Parse-This -- @dshanske, what do you think? I'm happy to handle it in Yarns but I expect this would be useful in other cases of Parse-This as well.

I'm going to implement it in Yarns itself in the meantime since it's pretty simple and I want jsonfeeds to work asap

jackjamieson2 commented 5 years ago

Similarly, items parsed from jsonfeeds are missing a type='entry' property

dshanske commented 5 years ago

@jackjamieson2 Will fix this. It should be on the library side

jackjamieson2 commented 5 years ago

Great, I implemented a quick fix to the dev branch of yarns but I agree it should be in the library

On Wed, Jun 19, 2019 at 6:07 PM David Shanske notifications@github.com wrote:

@jackjamieson2 https://github.com/jackjamieson2 Will fix this. It should be on the library side

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackjamieson2/yarns-microsub-server/issues/80?email_source=notifications&email_token=AC5U5R4XQIGBYVUEYJOT6FTP3KU2JA5CNFSM4HZMY342YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYDNNMI#issuecomment-503764657, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5U5RZUCVMD4L4TJSA7KQ3P3KU2JANCNFSM4HZMY34Q .

dshanske commented 5 years ago

@jackjamieson2 If you look at the JSONfeed you cited, and all micro.blog jsonfeeds, no author property exists. I'll fix the other problem.

dshanske commented 5 years ago

Not every feed has an author provided. Not sure what Microsub expects if there isn't one provided.

jackjamieson2 commented 5 years ago

Ah, I thought that might have been a jsonfeed convention, but I didn't check the spec.

Nonetheless, my inclination would be to interpret the feed name url and photo properties as belonging to the author. At least for Micro.blog feeds since that seems to be the typical use. Without that, jsonfeeds from Micro.blog are rendered in Monocle (and presumably other clients, though I didn't check yet) as having no author.

Beyond that, it looks like there's discussion of using a _source property to handle feed names etc. apart from authors https://github.com/indieweb/microsub/issues/13

I'm heading to sleep now so I'll check properly in the morning, but it looks like this is implemented in Monocle (in views/timeline/author-card.php)

jackjamieson2 commented 5 years ago

Just tried adding the feed name etc. to _source - It does not display in Monocle. (Looking at Monocle's source).

Screen Shot 2019-06-20 at 11 23 05 AM Screen Shot 2019-06-20 at 11 23 20 AM
dshanske commented 5 years ago

I would rather start providing a source property for everything than the alternative

jackjamieson2 commented 5 years ago

Makes sense. I think I’ll keep this workaround in Yarns temporarily, and remove it if/when _source can be used more reliably.

On Thu, Jun 20, 2019 at 1:06 PM David Shanske notifications@github.com wrote:

I would rather start providing a source property for everything than the alternative

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jackjamieson2/yarns-microsub-server/issues/80?email_source=notifications&email_token=AC5U5R24ACHVAXCRWMOGL6DP3O2HRA5CNFSM4HZMY342YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYGAZWI#issuecomment-504106201, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5U5R6ZVNCIRGLR57RWQZLP3O2HRANCNFSM4HZMY34Q .