Skip to content

Commit

Permalink
Fix atom parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Xstoudi committed Oct 9, 2017
1 parent 7639a27 commit ee3ac00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/script/components/modals/add-feed-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class AddFeedModal extends React.Component {
this._reset()
} else
this.props.addAddFeedError(error instanceof BadFeedType ? 'Unrecognized feed type' : 'Failed to fetch feed')
console.log(error)

// Unblock UI
this.props.hideLoader()
Expand Down
2 changes: 1 addition & 1 deletion src/script/utils/feed-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function fetchAtomFeed(url) {
const feedContent = await get(url).then(res => res.text())
if (!feedRegexps.atom.test(feedContent)) throw new BadFeedType()

return new XmlDocument(feedContent).childNamed('channel').childrenNamed('item').map(item => ({
return new XmlDocument(feedContent).childrenNamed('entry').map(item => ({
id: item.valueWithPath('id').trim(),
title: item.valueWithPath('title').trim(),
content: fixSrcset(item.valueWithPath('summary') || item.valueWithPath('content') || item.valueWithPath('subtitle') || '<i>Can\'t find content</i>').trim(),
Expand Down

0 comments on commit ee3ac00

Please sign in to comment.