PaulMougel / msgr2

Monsignor RSS Reader
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Some feeds aren't correctly added (related to xmlUrl field) #19

Closed PaulMougel closed 11 years ago

PaulMougel commented 11 years ago

With this feed: http://www.pcinpact.com/rss/news.xml, here is what feed-wrapper.js get_meta gets on a meta event:

{ '#ns': [ { 'xmlns:a10': 'http://www.w3.org/2005/Atom' } ],
  '@': [ { 'xmlns:a10': 'http://www.w3.org/2005/Atom' } ],
  '#xml': { version: '1.0', encoding: 'utf-8' },
  '#type': 'rss',
  '#version': '2.0',
  title: 'PC INpact',
  description: 'Actualités Informatique',
  date: Fri Jul 05 2013 13:17:29 GMT+0200 (CEST),
  pubdate: Fri Jul 05 2013 13:17:29 GMT+0200 (CEST),
  pubDate: Fri Jul 05 2013 13:17:29 GMT+0200 (CEST),
  link: 'http://www.pcinpact.com/',
  xmlurl: null,
  xmlUrl: null,
  author: null,
  language: null,
  favicon: null,
  copyright: null,
  generator: null,
  cloud: {},
  image: {},
  categories: [],
  'rss:@': {},
  'rss:title': { '@': {}, '#': 'PC INpact' },
  'rss:link': { '@': {}, '#': 'http://www.pcinpact.com/' },
  'rss:description': { '@': {}, '#': 'Actualités Informatique' },
  'rss:lastbuilddate': { '@': {}, '#': 'Fri, 05 Jul 2013 11:17:29 Z' },
  'a10:id': { '@': {}, '#': 'http://www.pcinpact.com' } }

The xmlUrl property equals to null, and the feed isn't correctly added to the database (with a wrong id).


Another example is: https://news.ycombinator.com/rss, get_meta result:

{ '#ns': [],
  '@': [],
  '#xml': {},
  '#type': 'rss',
  '#version': '2.0',
  title: 'Hacker News',
  description: 'Links for the intellectually curious, ranked by readers.',
  date: null,
  pubdate: null,
  pubDate: null,
  link: 'https://news.ycombinator.com/',
  xmlurl: null,
  xmlUrl: null,
  author: null,
  language: null,
  favicon: null,
  copyright: null,
  generator: null,
  cloud: {},
  image: {},
  categories: [],
  'rss:@': {},
  'rss:title': { '@': {}, '#': 'Hacker News' },
  'rss:link': { '@': {}, '#': 'https://news.ycombinator.com/' },
  'rss:description': 
   { '@': {},
     '#': 'Links for the intellectually curious, ranked by readers.' } }

and here is what is added to the database:

capture decran 2013-07-05 a 16 18 52

And the list goes on: http://www.engadget.com/rss.xml

Yimgo commented 11 years ago

Instead of rejecting bad feeds, commit f60cabde84bcc5fb9953ea1420e9781ee68e14c0 fixes them.