feeds: move mimetypes into .py from .ini
parent
7644c550ec
commit
e9d46cb6a9
|
@ -3,14 +3,6 @@ mode = xpath
|
||||||
path =
|
path =
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
mimetype =
|
|
||||||
text/xml
|
|
||||||
application/xml
|
|
||||||
application/rss+xml
|
|
||||||
application/rdf+xml
|
|
||||||
application/atom+xml
|
|
||||||
application/xhtml+xml
|
|
||||||
|
|
||||||
;RSS, rdf:rdf
|
;RSS, rdf:rdf
|
||||||
;RSS, channel
|
;RSS, channel
|
||||||
;Atom
|
;Atom
|
||||||
|
|
|
@ -241,6 +241,8 @@ class ParserBase(object):
|
||||||
|
|
||||||
class ParserXML(ParserBase):
|
class ParserXML(ParserBase):
|
||||||
ruleset = 'rss'
|
ruleset = 'rss'
|
||||||
|
mimetype = ['text/xml', 'application/xml', 'application/rss+xml',
|
||||||
|
'application/rdf+xml', 'application/atom+xml', 'application/xhtml+xml']
|
||||||
|
|
||||||
NSMAP = {'atom': 'http://www.w3.org/2005/Atom',
|
NSMAP = {'atom': 'http://www.w3.org/2005/Atom',
|
||||||
'atom03': 'http://purl.org/atom/ns#',
|
'atom03': 'http://purl.org/atom/ns#',
|
||||||
|
@ -397,6 +399,7 @@ def parse_time(value):
|
||||||
|
|
||||||
class ParserJSON(ParserBase):
|
class ParserJSON(ParserBase):
|
||||||
ruleset = 'json'
|
ruleset = 'json'
|
||||||
|
mimetype = ['application/json', 'application/javascript', 'text/javascript']
|
||||||
|
|
||||||
def parse(self, raw):
|
def parse(self, raw):
|
||||||
return json.loads(raw)
|
return json.loads(raw)
|
||||||
|
|
Loading…
Reference in New Issue