~Dc?@s dZdZdZdZdddddgZd Zd eZd Zd gZd Z d dgZ ddk Z ddk Z ddk Z ddkZddkZddkZddkZddkZddkZddkZddkZyddklZWnddklZnXyddkZWn eZnXyddkZWn eZnXy6ddkZeiieddk l!Z"dZ#Wnd Z#hdZ"nXyddk$Z$ddk%Z%WneZ$Z%nXyddk&Z'WnnXyddk(Z(WnnXy3ddk)Z)eoddk*Z)de)i+_nWn eZ)nXde,fdYZ-de-fdYZ.de-fdYZ/de-fdYZ0de,fdYZ1e i2de _3e i2d e _4e i2d!e _5hd"d#<d$d%<d&d'<d(d)<d*d+<d,d-<d.d/<d0d1<d2d3<d4d5<d6d7<d8d9<d:d;<d<d=<d>d?<d@dA<dBdCdJe>dK<e>dLe>dM<e>dNe>dO<e>dPe>dQ<e>dRe>dS<e>dTe>dU<e>dVe>dW<e>dXe>dY<e>dZe>d[<e>d\e>d]<e>d^e>d_<e>d`e>da<e>dbe>dc<e>dde>de<e>dfe>dg<e>dhe>di<e>dje>dk<e>dle>dm<e>dne>do<e>dpe>dq<e>dre>ds<e>dte>du<e>dve>dw<e>dxe>dy<e>dze>d{<e>d|e>d}<e>d~e>d s4.1sCopyright (c) 2002-2006, Mark Pilgrim, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.s'Mark Pilgrim s%Jason Diamond s'John Beimler s1Fazal Majid s"Aaron Swartz s(Kevin Marks is.UniversalFeedParser/%s +http://feedparser.org/sapplication/atom+xml,application/rdf+xml,application/rss+xml,application/x-netcdf,application/xml;q=0.9,text/xml;q=0.2,*/*;q=0.1t drv_libxml2tuTidytmxTidyiN(tStringIO(tescapeicCsc|idd}|idd}|idd}x&|D]\}}|i||}q=W|S(Nt&s&t>s>ti?iiiiiiiiii`i:i#i@i'i=i"iiaibicidieifigihiiiiiiiiiijikiliminioipiqiriiiiiiii~isitiuiviwixiyiziiiiiiiiiiiiiiiiiiiiiii{iAiBiCiDiEiFiGiHiIiiiiiii}iJiKiLiMiNiOiPiQiRiiiiiii\iiSiTiUiViWiXiYiZiiiiiii0i1i2i3i4i5i6i7i8i9iiiiiiiRi(iiiiii iiiiii i i iiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiii[i.i<i(i+i!i&iiiiiiiiii]i$i*i)i;i^i-i/iiiiiiiii|i,i%i_i>i?iiiiiiiiii`i:i#i@i'i=i"iiaibicidieifigihiiiiiiiiiijikiliminioipiqiriiiiiiii~isitiuiviwixiyiziiiiiiiiiiiiiiiiiiiiiii{iAiBiCiDiEiFiGiHiIiiiiiii}iJiKiLiMiNiOiPiQiRiiiiiii\iiSiTiUiViWiXiYiZiiiiiii0i1i2i3i4i5i6i7i8i9iiiiii(t_ebcdic_to_ascii_maptstringt maketranstjointmaptchrtranget translate(tstemapRq((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_ebcdic_to_asciis* :i ii iiii ii& ii ii! iiii0 ii`ii9 iiRii}ii ii ii ii ii" ii ii iiii"!iiaii: iiSii~iixis&^([A-Za-z][A-Za-z0-9+-.]*://)(/*)(.*?)cCs"tid|}ti||S(Ns\1\3(t _urifixertsubturlparseturljoin(tbaseturi((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_urljoin;st_FeedParserMixinc BsNeZhdd<dd<dd<dd<dd<dd<dd<dd<dd<dd <dd <dd <dd <d d<dd<dd<dd<dd<dd<dd<dd<dd<dd <d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<d5d7<d8d9<d:d;<d<d=<d>d?<d@dA<dBdC<dDdE<dFdG<dHdI<dJdK<dLdM<dNdO<dPdQ<dRdS<dTdU<dVdW<dXdY<dZd[<d\d]<d^d_<d`da<dbdc<ddde<dfdgdZ?e?Z@dZAeAZBdZCdZDdZEdZFdZGeGZHeGZIdZJeJZKeJZLdZMeMZNdZOeOZPdZQddZRdZSddZTdZUeUZVeUZWdZXeXZYeXZZdZ[e[Z\e[Z]dZ^e^Z_e^Z`dZaeaZbeaZcdZdedZedZfefZgdZhehZidZjejZkdZlelZmdZnenZoenZpdZqeqZreqZsdZtetZuetZvetZwetZxdZyeyZzeyZ{eyZ|eyZ}dZ~e~ZdZeZdZdZdZdZdZdZdZeZeZdZdZdZeZeZeZdZdZeZdZeZdZdZdZeZeZdZeZeZdZdZdZeZdZeZdZeZdZdZdZdZdZeZdZeZdZdZdZdZdZdZeZdZeZdZeZeZeZeZeZdZeZdZdZRS(Rshttp://backend.userland.com/rsss%http://blogs.law.harvard.edu/tech/rssshttp://purl.org/rss/1.0/s&http://my.netscape.com/rdf/simple/0.9/shttp://example.com/newformat#shttp://example.com/nechoshttp://purl.org/echo/suri/of/echo/namespace#shttp://purl.org/pie/shttp://purl.org/atom/ns#shttp://www.w3.org/2005/Atoms'http://purl.org/rss/1.0/modules/rss091#tadminshttp://webns.net/mvcb/tags,http://purl.org/rss/1.0/modules/aggregation/tannotates)http://purl.org/rss/1.0/modules/annotate/taudios!http://media.tangent.org/rss/1.0/t blogChannels-http://backend.userland.com/blogChannelModuletccshttp://web.resource.org/cc/tcreativeCommonss4http://backend.userland.com/creativeCommonsRssModuletcos'http://purl.org/rss/1.0/modules/companytcontents(http://purl.org/rss/1.0/modules/content/tcps&http://my.theinfo.org/changed/1.0/rss/tdcs http://purl.org/dc/elements/1.1/tdctermsshttp://purl.org/dc/terms/temails&http://purl.org/rss/1.0/modules/email/tevs&http://purl.org/rss/1.0/modules/event/t feedburners*http://rssnamespace.org/feedburner/ext/1.0tfmshttp://freshmeat.net/rss/fm/tfoafshttp://xmlns.com/foaf/0.1/tgeos(http://www.w3.org/2003/01/geo/wgs84_pos#ticbmshttp://postneo.com/icbm/timages&http://purl.org/rss/1.0/modules/image/tituness*http://www.itunes.com/DTDs/PodCast-1.0.dtds'http://example.com/DTDs/PodCast-1.0.dtdtls%http://purl.org/rss/1.0/modules/link/tmediashttp://search.yahoo.com/mrsstpingbacks4http://madskills.com/public/xml/rss/module/pingback/tprisms.http://prismstandard.org/namespaces/1.2/basic/trdfs+http://www.w3.org/1999/02/22-rdf-syntax-ns#trdfss%http://www.w3.org/2000/01/rdf-schema#trefs*http://purl.org/rss/1.0/modules/reference/treqvs*http://purl.org/rss/1.0/modules/richequiv/tsearchs'http://purl.org/rss/1.0/modules/search/tslashs&http://purl.org/rss/1.0/modules/slash/tsoaps)http://schemas.xmlsoap.org/soap/envelope/tsss.http://purl.org/rss/1.0/modules/servicestatus/tstrs-http://hacks.benhammersley.com/rss/streaming/R|s-http://purl.org/rss/1.0/modules/subscription/tsys,http://purl.org/rss/1.0/modules/syndication/ttaxos)http://purl.org/rss/1.0/modules/taxonomy/tthrs*http://purl.org/rss/1.0/modules/threading/ttis*http://purl.org/rss/1.0/modules/textinput/t trackbacks5http://madskills.com/public/xml/rss/module/trackback/twfws$http://wellformedweb.org/commentAPI/twikis%http://purl.org/rss/1.0/modules/wiki/txhtmlshttp://www.w3.org/1999/xhtmltxmls$http://www.w3.org/XML/1998/namespacetszfs/http://schemas.pocketsoap.com/rss/myDescModule/tlinkR3t wfw_commenttwfw_commentrsstdocsR=R<tcommentstlicenseticontlogottitleR:tinfoRHR9RERDR;s text/htmlsapplication/xhtml+xmlsutf-8cCs^totiidn|ip7x4|iiD]\}}||i|i                       cCstotiid||fng}|D]\}}||i|fq0~}g}|D]3\}}|||d"jo |ip|fqc~}t|}|id|idp|i}t|i||_|id|id} | djo d} n| djo |i } n| o"|d#jo| |i d RiiRdRRR;tnameR=R<twidththeightt_start_(Rstype(sfeedsrsssrdf:RDF(stitleslinks descriptionsname(stitleslinks descriptionsurlshrefswidthsheight(RRRRRR-RRRRRlRRRtappendRRgttrackNamespaceRRRVtendswithtsplitt handle_datatstrattrstfindRRRtgetattrRbtpush(RWRZtattrsRYR+R,t_[2]tattrsDRRtprefixRtsuffixt methodnametmethod((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytunknown_starttagsZ3G %        =# *   cCstotiid|n|iddjo|idd\}}nd|}}|ii||}|o|d}nd||}yt||}|Wn$t j o|i ||nX|i oD|i i do1|i idd id  od |i dRi(RRRRRRRRRRRbtpopRRRVRRRRRR(RWRZRRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytunknown_endtags6  =#     c Cs|ipdSn|i}|djod |}nJ|d d jot|dd}n t|}t|id}|iddi|dS(Nt34t38t39t60t62tx22tx26tx27tx3ctx3es&#%s;itxiisutf-8ii( RRRRRRRRRR(RRtinttunichrtencodeR(RWRttexttc((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pythandle_charrefs    cCs|ipdSntotiid|n|d jod|}nSd}y||Wntj od|}nXt||id }|id d i|dS( Ns"entering handle_entityref with %s tlttgttquottamptaposs&%s;cSswddk}t|do|i|Sn|i|}|ido%|idot|dd!Snt|S(Nitname2codepoints&#t;i(thtmlentitydefsRaR t entitydefsRgRRtord(R+R ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytname2cp's   sutf-8ii(sltsgtRRR ( RRRRRRfRRR(RWRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pythandle_entityrefs   icCs^|ipdSn|o)|iiddjot|}n|iddi|dS(NRSsapplication/xhtml+xmlii(RRRRR R(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR4s   cCsdS(N((RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pythandle_comment<scCsdS(N((RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt handle_pi@scCsdS(N((RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt handle_declDscCstotiidn|i||d!djoe|iid|}|djot|i}n|it|i|d|!d|dSn|iid|}|d SdS( Nsentering parse_declaration i s iiiRi( RRRRtrawdataRtlenRR (RWtiR+((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytparse_declarationGs $ cCsU|i}|djo d}n/|djo d}n|djo d}n|S(NRs text/plainthtmls text/htmlRsapplication/xhtml+xml(R(RWt contentType((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytmapContentTypeSs       cCs|i}||fd jo|i o d|_n|djo|i o d|_n|djo|i o d|_n|iddjod }|}n|ii|o,|i||i|<||i|i|s
sRtbase64tmodes text/htmlusutf-8s iso-8859-1RKRR^RtlinksR<R;R:t_detailR9(*RRRRRRRgRRststripR"t decodestringtbinasciitErrort Incompletetcan_be_relative_uriRRRfRt html_typestcan_contain_relative_urist_resolveRelativeURIsRRtcan_contain_dangerous_markupt _sanitizeHTMLRStunicodeRtcp1252RRR1R`tcopytdeepcopyRRRRRt _getContext( RWRtstripWhitespaceR!tpiecestdepthtpiecetoutputRYRRtcontext((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR{s ,=   ! ( (#)F    !    *       cCs|id7_th|i|id|d<|id<|id<|_|i||i|id<|i||dS(NiRSRRR"( RR.RRRRRRt _isBase64R(RWRZRtdefaultContentTypeR!((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt pushContents cCs/|i|}|id8_|ii|S(Ni(RRRtclear(RWRZR^((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt popContents cCs_|id}|djo?|| }||d}|ii||}|d|}n|S(NRii(RRRR(RWRtcolonposRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_mapToStandardPrefixs  cCs|i|i|S(N(RRRB(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _getAttribute scCs|idddjodSn|ididodSn|ididodSn|idid odSndS( NR#RR"iRSstext/is+xmls/xml(RRRRgR(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR< sc Cs|id|id|idd}|oPy |d=Wntj onXy |d=Wntj onX||d(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_subtitle!scCs|iddS(NR9(R@(RW((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _end_subtitle&scCs|id|dddS(NRDs text/plaini(R>(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _start_rights+scCs|iddS(NRD(R@(RW((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _end_rights0scCsy|iit|iddd|_d|_|i|d}|o|i}||dRRR(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _start_titlescCsW|id}|i}|io||ddRRR(RWRR;((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_descriptions   cCs1|id|d|ip|ip|idS(NR;s text/plain(R>RRR(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_abstractscCs~|idjo|inT|id}|i}|io||dd(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _start_info scCs|iddS(NR(R@(RW((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _end_info scCso|o>|i|}|ido|i|d|d(RWRR;((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_summary.s    cCsB|idjo|in|i|ipdd|_dS(NRR:(RRR@Rl(RW((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _end_summary8scCs||i|}|iidgit||id}|o.|i}|idp||dRRRR(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRQs cCs|id|dddS(NRs text/htmli(R>(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_prodlinkXscCs|id|dddS(NRsapplication/xhtml+xmli(R>(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _start_body[scCs|id|dddS(NRs text/htmli(R>(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_start_content_encoded_scCsY|i|iiddg|ij}|id}|o|id|ndS(NRSs text/plainRR;(RRRRR,R@RE(RWtcopyToDescriptionR^((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRcs+cCs<|iddth|idd<|idR@RBRCR<RDRERHRIRKt_start_feedinfoRJRQRRt _end_feedRSRTRVt_start_textInputRWt_end_textInputRYt_start_managingeditort_start_dc_authort_start_dc_creatort_start_itunes_authorR[t_end_managingeditort_end_dc_authort_end_dc_creatort_end_itunes_authorR]R^RaRbRcReRft_start_itunes_nameRdt_end_itunes_nameRiRjRkRlRmt_start_homepaget _start_uriRnt _end_homepaget_end_uriRot_start_itunes_emailRpt_end_itunes_emailR5RgRhRZRwt_start_taglinet_start_itunes_subtitleRxt _end_taglinet_end_itunes_subtitleRyt_start_dc_rightst_start_copyrightRzt_end_dc_rightst_end_copyrightR}t _start_entryt_start_productR~t _end_entryRt_start_languageRt _end_languageRt_start_webmasterRt_end_webmasterRt_start_dcterms_issuedt _start_issuedRt_end_dcterms_issuedt _end_issuedRRMt_start_dcterms_modifiedt_start_pubdatet_start_dc_dateRRNt_end_dcterms_modifiedt _end_pubdatet _end_dc_dateRt_start_dcterms_createdRt_end_dcterms_createdRRRRRRRt_start_dc_subjectt_start_keywordsRRRt_end_dc_subjectt _end_keywordst_end_itunes_categoryRROt_start_producturlRPt_end_producturlRRRt_start_dc_titlet_start_media_titleRt _end_dc_titlet_end_media_titleRRRt _end_abstractRt!_start_feedburner_browserfriendlyRt_end_feedburner_browserfriendlyRRRRRt_start_itunes_summaryRt_end_itunes_summaryRRRRRRt_start_xhtml_bodyRt_start_fullitemRt _end_bodyt_end_xhtml_bodyt_end_content_encodedt _end_fullitemt _end_prodlinkRt_start_itunes_linkRR(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR?s                                                           '!! " F %            v                                                                                    t_StrictFeedParsercBsGeZdZdZdZdZdZdZdZRS(cCs]totiidntiiii|t i||||d|_ d|_ dS(Nstrying StrictFeedParser i( RRRRRtsaxthandlertContentHandlerRRtbozoRltexc(RWRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR}s  cCs|i||dS(N(R(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytstartPrefixMappingsc Cs"|\}}t|pdi}|iddjod}|}n|o-|iddjo|idd}nd}|ii||}|oL|djp|djo|djo%|ii| ot d|n|o|d|}nt|i}t o0t i i d|||||i|fnh} xz|iiD]i\\}} } |pdi}|ii|d}|o|d| } n| | t| is>s't's"Ru( Rstcompilet IGNORECASER|R6RRRSRR1R2R/tclose(RWR ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR/s!#c Cs~g}|D]\}}||i|fq ~}g}|D]3\}}|||djo |ip|fq>~}|S(NRRS(srelstype(R(RWRRYR+R,R((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytnormalize_attrss3Gc Cstotiid|ng}xb|D]Z\}}t|tdjot||i}n|it||i|fq,Wdig}|D]\}}|d||fq~i |i}||i jo|i idt n|i idt dS(Ns-_BaseHTMLProcessor, unknown_starttag, tag=%s uu %s="%s"s<%(tag)s%(strattrs)s />s<%(tag)s%(strattrs)s>( RRRRRSR1RRRsRR4R7tlocals(RWRZRtuattrsRXR^RYR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs #FcCs/||ijo|iidtndS(Ns (R4R7RR<(RWRZ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCs|iidtdS(Ns &#%(ref)s;(R7RR<(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCsfddk}t|d p|ii|o|iidtn|iidtdS(NiR s &%(ref)s;s &%(ref)s(R RaR RVR7RR<(RWRR ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs $cCs3totiid|n|ii|dS(Ns)_BaseHTMLProcessor, handle_text, text=%s (RRRRR7R(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCs|iidtdS(Ns(R7RR<(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCs|iidtdS(Ns (R7RR<(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCs|iidtdS(Ns (R7RR<(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRss-zA-Z][-_.a-zA-Z0-9:]*\s*cCs|i}t|}||jodSn|i||}|oQ|i}|i}|t||jodSn|i|ifSn|i|dSdS(Ni(Ni(Ni(Ni( RRRlt_new_declname_matchRtR&RtendR(RWRt declstartposRtntmRxR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _scan_name's      cCs1dig}|iD]}|t|q~S(s(Return processed HTML as a single stringR(RsR7R(RWRYtp((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR:8s(RRR4RR3R6R/R;RRRRRRRRRsR8R5R>RCR:(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR%s$            t_LooseFeedParsercBs#eZdZdZdZRS(cCs*tii|ti||||dS(N(R1R2RR(RWRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR=scCsm|idd}|idd}|idd}|idd}|idd}|idd}|id d }|id d }|id d }|idd }|idd}|idd}|iido~|iiddid o^|idd}|idd}|id d}|id d}|idd}n|S(Ns<s<s<s<s>s>s>s>s&s&s&s"s"s"s's's'RSRRRRRR7(RRRVRRR(RWRR ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRAs&3cCs,dig}|D]}|d|q~S(NRs %s="%s"(Rs(RWRRYR ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRVs(RRRRR(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRE<s  t_RelativeURIResolvercBsteZdd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7gZdZdZdZRS(8taR<tapplettcodebaseR&t blockquotetcitetbodyt backgroundtdeltformtactionR*tlongdescRtiframetheadtprofileR,tusemapR-tinsRtobjecttclassidR tqtscriptcCsti||||_dS(N(R%RR(RWRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRtscCst|i|S(N(RR(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRxscCsy|i|}g}|D]?\}}||||f|ijo|i|p|fq~}ti|||dS(N(R;t relative_urisRR%R(RWRZRRYRXR^((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR{sS(RGshref(RHRI(sareashref(RJRK(RLRM(RNRK(ROsaction(sframeRQ(sframessrc(RRRQ(RRssrc(sheadRT(simgRQ(simgssrc(simgRU(sinputssrc(sinputRU(RVRK(slinkshref(sobjectRX(sobjectRI(sobjectsdata(sobjectRU(RYRK(RZssrc(RRR[RRR(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRFYs8   cCsAtotiidnt||}|i||iS(Nsentering _resolveRelativeURIs (RRRRRFR/R:(t htmlSourcetbaseURIRRD((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR.s  t_HTMLSanitizercHBseZdddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFgGZddGdHdIdJdKdLdMdNdOdPdQdRdSdTd dUdVdWdXdYdZd[d\dd]d^d_d`dadbdcdddedfdgd'dhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d6d}d~dddddddddddgHZddgZdZdZdZdZdZ dZ RS(RGtabbrtacronymtaddressR&tbtbigRJR(tbuttontcaptiontcenterRKtcodeR)tcolgrouptddRNtdfntdirtdivtdltdttemtfieldsettfontROth1th2th3th4th5th6R+RR,R-RVtkbdRtlegendtliRttmenutoltoptgrouptoptionRDtpreRYRxtsamptselecttsmalltspantstriketstrongR|tsupttablettbodyttdttextareattfoottthttheadttrttttutultvartacceptsaccept-charsett accesskeyRPtaligntalttaxistbordert cellpaddingt cellspacingR tcharofftcharsettcheckedtclassR?tcolstcolspantcolortcompacttcoordstdatetimetdisabledtenctypetforR*theadersRR<threflangthspaceR3tismapRRQt maxlengthRRtmultipleRtnohreftnoshadetnowraptprompttreadonlyRtrevtrowstrowspantrulestscopetselectedtshapetsizeRtstartR:ttabindexttargetRRSRUtvalignR^tvspaceRsxml:langRZRHcCsti|d|_dS(Ni(R%R3tunacceptablestack(RW((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR3s cCs||ijo+||ijo|id7_ndSn|i|}g}|D]-\}}||ijo|||fqUqU~}ti|||dS(Ni(tacceptable_elementst"unacceptable_elements_with_end_tagRR;tacceptable_attributesR%R(RWRZRRYRXR^((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRsAcCsO||ijo+||ijo|id8_ndSnti||dS(Ni(RRRR%R(RWRZ((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs cCsdS(N((RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCsdS(N((RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRscCs"|ipti||ndS(N(RR%R(RWR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs ( RRRRRR3RRRRR(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR^s2$      c st|}|i||i}tod}x~tD]v}yf|djo$ddklfd}Pn2|djo$ddkl fd}PnWq9q9Xq9W|ot |t dj}|o|i d }n||d d d d d ddd}|ot |d }n|i doD|idd d }|i do|idd d }q~n|i do|idd d}qqn|iidd}|S(NRi(t parseStringcst||S(N(R(R tkwargs(t_utidy(s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_tidysR(tTidycs"i||\}}}}|S(N(ttidy(R Rtnerrorst nwarningst errordata(t_mxtidy(s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRsusutf-8t output_xhtmlitnumeric_entitiestwrapit char_encodingtutf8seZdZdZdZeZeZeZdZRS(cCsc|ddjo*|djo|i|||||Snti|||i}||_|S(Nidii0(thttp_error_302turllibt addinfourlt get_full_urltstatus(RWtreqtfpRgtmsgRtinfourl((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pythttp_error_defaults  cCst|iido%tii||||||}nti|||i}t|dp ||_ n|S(NtlocationR( R-RVturllib2tHTTPRedirectHandlerRRRRRaR(RWRRRgRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs % cCst|iido%tii||||||}nti|||i}t|dp ||_ n|S(NRR( R-RVRRthttp_error_301RRRRaR(RWRRRgRRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs % c Csti|id}ytiiddjpttdjptti|i diddid\}}t i d|dd} |i | ||||i d |||} |i| SWn |i|||||SnXdS( Niis2.3.3t Authorizationt Rsrealm="([^"]*)"sWWW-Authenticateswww-authenticate(R}RRRRRhR"RlR'RRstfindallt add_passwordthttp_error_auth_reqedtreset_retry_countR( RWRRRgRRthosttusertpasswtrealmtretry((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pythttp_error_401s !2 ( RRRRRthttp_error_300thttp_error_303thttp_error_307R(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs  c Cst|do|Sn|djo tiSnti|dd1jo|p t}nd0}toti|\}}ti |\} }| oLti | \} } | o,d|| |f}ti | i }qqnt i|} | id||o| id |n|od d d d dddg} ddddddddddddg } | idd| |d|d | |d!d!|d|d"|d#|d$fn|o| id%|ntoto| id&d'nGto| id&d(n,to| id&d)n| id&d*|o| id+d,|nto| id-tn| id.d/tt ittg|}g|_z|i| SWd0|iXnyt|SWnnXtt|S(2s8URL, filename, or string --> stream This function lets you define parsers that take any input source (URL, pathname to local or network file, or actual data as a string) and deal with it in a uniform manner. Returned object is guaranteed to have all the basic stdio read methods (read, readline, readlines). Just .close() the object when you're done with it. If the etag argument is supplied, it will be used as the value of an If-None-Match request header. If the modified argument is supplied, it must be a tuple of 9 integers as returned by gmtime() in the standard Python time module. This MUST be in GMT (Greenwich Mean Time). The formatted date/time will be used as the value of an If-Modified-Since request header. If the agent argument is supplied, it will be used as the value of a User-Agent request header. If the referrer argument is supplied, it will be used as the value of a Referer[sic] request header. If handlers is supplied, it is a list of handlers used to build a urllib2 opener. treadt-ithttpthttpstftps %s://%s%ss User-Agents If-None-MatchtMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDecsIf-Modified-Sinces#%s, %02d %s %04d %02d:%02d:%02d GMTiiiiiitReferersAccept-encodings gzip, deflatetgziptdeflateRRsBasic %stAcceptsA-IMR/N(shttpshttpssftp(RaRtstdinR}t USER_AGENTRlR"Rt splittypet splithostt splitusert encodestringR&RtRequestt add_headerRtzlibt ACCEPT_HEADERtapplyt build_openerttupleRt addheaderstopenR:t _StringIOR(turl_file_stream_or_stringtetagR>tagenttreferrerthandlerstauthturltypetresttrealhostt user_passwdtrequesttshort_weekdaystmonthstopener((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_open_resources`   !*U" cCstid|dS(sLRegister a date handler function (takes string, returns 9-tuple date in GMT)iN(t_date_handlerstinsert(tfunc((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pytregisterDateHandlersss YYYY-?MM-?DDsYYYY-MMs YYYY-?OOOs YY-?MM-?DDsYY-?OOOtYYYYs-YY-?MMs-OOOs-YYs--MM-?DDs--MMs---DDtCCs(?P\d{4})tYYs(?P\d\d)tMMs(?P[01]\d)tDDs(?P[0123]\d)tOOOs(?P[0123]\d\d)s(?P\d\d$)s$(T?(?P\d{2}):(?P\d{2})s(:(?P\d{2}))?s6(?P[+-](?P\d{2})(:(?P\d{2}))?|Z)?)?c Csd}x&tD]}||}|oPq q W|pdSn|idjodSn|i}|idd}|ot|}nd}|idd}| p |djotid}nLt|djo,dttiddt|}n t|}|idd }| p |d jo%|o d }qftid }nt|}|id d}|ph|o |}q|id dp&|iddp|iddo d }qtid}n t|}d |i jo t|d d dd }nx>d ddddgD]'}|i|dpd||tfieldR@RARBtweekdaytdaylight_savings_flagttmRE((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_iso8601sv   ,    &    "&"&u년u월u일u오전u오후s;(\d{4})%s\s+(\d{2})%s\s+(\d{2})%s\s+(\d{2}):(\d{2}):(\d{2})u>(\d{4})-(\d{2})-(\d{2})\s+(%s|%s)\s+(\d{,2}):(\d{,2}):(\d{,2})cCsti|}|pdSndh|idd<|idd<|idd<|id d <|id d <|id d<dd<}totiid|nt|S(s8Parse a string according to the OnBlog 8-bit date formatNsE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)siR<iR=iR>iR@iRAiRBs+09:00tzonediffsOnBlog date parsed as: %s (t_korean_onblog_date_reR5RtRRRRt_parse_date_w3dtf(RNRBt w3dtfdate((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_onblogs:6 cCs)ti|}|pdSnt|id}|id}|tjo|d7}nt|}t|djod|}ndh|idd<|id d <|id d <|d <|idd<|idd<dd<}toti i d|nt |S(s6Parse a string according to the Nate 8-bit date formatNiii it0sE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)sR<iR=iR>R@iRAiRBs+09:00RVsNate date parsed as: %s ( t_korean_nate_date_reR5RRtt _korean_pmRRRRRRRX(RNRBR@tampmRY((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_nates"  :- s9(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})(\.\d+)?cCsti|}|pdSndh|idd<|idd<|idd<|id d <|id d <|id d<dd<}totiid|nt|S(s2Parse a string according to the MS SQL date formatNsE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)siR<iR=iR>iR@iRAiRBs+09:00RVsMS SQL date parsed as: %s (t_mssql_date_reR5RtRRRRRX(RNRBRY((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_mssqls:6 uJanuΙανuFebuΦεβuMaruΜάώuΜαώuApruΑπρuMayuΜάιuΜαϊuΜαιuJunuΙούνuΙονuJuluΙούλuΙολuAuguΑύγuΑυγuSepuΣεπuOctuΟκτuNovuΝοέuΝοεuDecuΔεκuSunuΚυρuMonuΔευuTueuΤριuWeduΤετuThuuΠεμuFriuΠαρuSatuΣαβuL([^,]+),\s+(\d{2})\s+([^\s]+)\s+(\d{4})\s+(\d{2}):(\d{2}):(\d{2})\s+([^\s]+)cCsti|}|pdSny*t|id}t|id}Wn dSnXdh|d<|idd<|d<|id d <|id d <|id d<|idd<|idd<}totiid|nt |S(s6Parse a string according to a Greek 8-bit date format.NiisP%(wday)s, %(day)s %(month)s %(year)s %(hour)s:%(minute)s:%(second)s %(zonediff)stwdayiR>R=iR<iR@iRAiRBiRVsGreek date parsed as: %s ( t_greek_date_format_reR5t _greek_wdaysRtt _greek_monthsRRRRt_parse_date_rfc822(RNRBRbR=t rfc822date((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_greekEs:6u01ujanuáru02u februáriu03umárciusu04uáprilisu05umáujusu06ujúniusu07ujúliusu08u augusztusu09u szeptemberu10uoktóberu11unovemberu12udecemberu?(\d{4})-([^-]+)-(\d{,2})T(\d{,2}):(\d{2})((\+|-)(\d{,2}:\d{2}))cCs'ti|}|pdSnywt|id}|id}t|djod|}n|id}t|djod|}nWn dSnXdh|idd<|d <|d <|d <|id d <|idd<}totiid|nt |S(s:Parse a string according to a Hungarian 8-bit date format.NiiiR[is:%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s%(zonediff)sR<R=R>R@iRAiRVsHungarian date parsed as: %s ( t_hungarian_date_format_reR5t_hungarian_monthsRtRRRRRRX(RNRBR=R>R@RY((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parse_date_hungarianjs((c Csd}d}d}d}d}ti|}d|}d||f}ti|} | i|} | djp| i|jodSn|| || d } | ddjodSntiti| || tiS( Nc Sst|id}|djo,dttiddt|}n|djod Sn|id}|ot|}|dd}|dd}d}x||joti|||ddddddf }ti|d}t||}||jo/||jo||}qz|d}d }q||jo-||d jo||}qz|d}qqW|||fSn|id }d}|djo d}n9t|}|id }|ot|}nd}|||fS(NR<idiitjulianiiiiiR=R>(iii(RRtRJRKRlRMtabs(RBR<RlR=R>tjdayR tdiff((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt__extract_datesH ,   *        cSs|pdSn|id}|pdSnt|}t|id}|id}|ot|}nd}|||fS(Nithourstminutestseconds(iii(iii(RtR(RBRqRrRs((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt__extract_times cSs|pdSn|id}|pdSn|djodSnt|id}|id}|ot|}nd}|d|d}|ddjo | Sn|S(sAReturn the Time Zone Designator as an offset in seconds from UTC.ittzdRFttzdhourst tzdminutesi<RG(RtR(RBRuRqRrtoffset((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt __extract_tzds   sd(?P\d\d\d\d)(?:(?P-|)(?:(?P\d\d\d)|(?P\d\d)(?:(?P=dsep)(?P\d\d))?))?s;(?P[-+](?P\d\d)(?::?(?P\d\d))|Z)sW(?P\d\d)(?P:|)(?P\d\d)(?:(?P=tsep)(?P\d\d(?:[.,]\d+)?))?s %s(?:T%s)?i(iii( RsR8R5RlRtRJRKRMttimezone( RNRpRtRyt __date_ret__tzd_ret__tzd_rxt __time_ret __datetime_ret __datetime_rxRBtgmt((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRXs" )   cCs|i}|dddjp|ditijo |d=nt|djof|d}|id}|djo || ||dg|d)n|id d i|}nt|d jo|d 7}nti|}|ot i ti |Snd S(s8Parse an RFC822, RFC1123, RFC2822, or asctime-style dateiit,t.iiRGiRRis 00:00:00 GMTN(RR( RRtrfc822t _daynamesRRRRst parsedate_tzRJRKt mktime_tz(RNR RxRRT((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRfs /     iptATi tETitCTiDtMTitPTcCsxtD]}yg||}|pwnt|djo%totiidntntt||SWqt j o7}to'tiid|i t |fqqXqWdS(s6Parses a variety of date formats into a 9-tuple in GMTi s*date handler function must return 9-tuple s %s raised %s N( R1RRRRRt ValueErrorRtRt ExceptionRRRl(RNRt date9tuplete((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyRs"   ' c Csd}d}d}d}||id\}}yj|d djot|}n.|d djo"d}t|did}nt|djoK|d d jo:|d d!d jo&d}t|d did}n|d d jo"d }t|d id}njt|djoK|d djo:|d d!d jo&d }t|d d id}n |d djo"d}t|did}n|d djo"d}t|did}n|d djo&d}t|ddid}no|d djo&d}t|ddid}n8|d djo&d}t|ddid}ntidi|}Wn d0}nX|o8|i di }|o|d1jo |}qnd} d2} d3} || jp |i d*o.|i d+od,} |p |pd}n|| jp |i d-o'|i d+od,} |pd.}nX|i d-o|pd.}n7|o"|i d o|pd/}n|pd}||||| fS(4s Get the character encoding of the XML document http_headers is a dictionary xml_data is a raw string (not Unicode) This is so much trickier than it sounds, it's not even funny. According to RFC 3023 ('XML Media Types'), if the HTTP Content-Type is application/xml, application/*+xml, application/xml-external-parsed-entity, or application/xml-dtd, the encoding given in the charset parameter of the HTTP Content-Type takes precedence over the encoding given in the XML prefix within the document, and defaults to 'utf-8' if neither are specified. But, if the HTTP Content-Type is text/xml, text/*+xml, or text/xml-external-parsed-entity, the encoding given in the XML prefix within the document is ALWAYS IGNORED and only the encoding given in the charset parameter of the HTTP Content-Type header should be respected, and it defaults to 'us-ascii' if not specified. Furthermore, discussion on the atom-syntax mailing list with the author of RFC 3023 leads me to the conclusion that any document served with a Content-Type of text/* and no charset parameter must be treated as us-ascii. (We now do this.) And also that it must always be flagged as non-well-formed. (We now do this too.) If Content-Type is unspecified (input was local file or non-HTTP source) or unrecognized (server just got it totally wrong), then go by the encoding given in the XML prefix of the document and default to 'iso-8859-1' as per the HTTP specification (RFC 2616). Then, assuming we didn't find a character encoding in the HTTP headers (and the HTTP Content-type allowed us to look in the body), we need to sniff the first few bytes of the XML data and try to determine whether the encoding is ASCII-compatible. Section F of the XML specification shows the way here: http://www.w3.org/TR/REC-xml/#sec-guessing-no-ext-info If the sniffed encoding is not ASCII-compatible, we need to make it ASCII compatible so that we can sniff further into the XML declaration to find the encoding attribute, which will tell us the true encoding. Of course, none of this guarantees that we will be able to parse the feed in the declared character encoding (assuming it was declared correctly, which many are not). CJKCodecs and iconv_codec help a lot; you should definitely install them if you can. http://cjkpython.i18n.org/ cSsD|pd}ti|\}}||iddiddfS(s takes HTTP Content-Type header and returns (content type, charset) If no charset is specified, returns (content type, '') If no content type is specified, returns ('', '') Both return parameters are guaranteed to be lowercase strings RRR7(tcgit parse_headerRRR(t content_typeRP((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_parseHTTPContentType; s Rs content-typeisLot<?sutf-16besutf-8ists<?sutf-16lestisiso-10646-ucs-2sucs-2t csunicodesiso-10646-ucs-4sucs-4tcsucs4sutf-16sutf-32tutf_16tutf_32tutf16tu16sapplication/xmlsapplication/xml-dtds&application/xml-external-parsed-entitystext/xmlstext/xml-external-parsed-entitys application/s+xmlistext/sus-asciis iso-8859-1N( siso-10646-ucs-2sucs-2Rsiso-10646-ucs-4sucs-4Rsutf-16sutf-32sutf_16Rsutf16su16(sapplication/xmlsapplication/xml-dtds&application/xml-external-parsed-entity(stext/xmlstext/xml-external-parsed-entity(RRRzR1RRRsR8R5RltgroupsRRgRRV( t http_headerstxml_dataRtsniffed_xml_encodingt xml_encodingt true_encodingthttp_content_typet http_encodingtxml_encoding_matchtacceptable_content_typetapplication_content_typesttext_content_types((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_getCharacterEncoding sv0 8 8          c Cstotiid|nt|djou|d djod|dd!djoPto5tiid|djotiidqnd}|d}nt|djou|d d jod|dd!djoPto5tiid|d jotiid qnd }|d}n$|d d joPto5tiid|djotiidq|nd}|d }n|d djoPto5tiid|djotiidqnd}|d}nb|d djoPto5tiid|djotiidq>nd}|d}nt||}totiid|ntid}d}|i|o|i ||}n|d|}|i dS(sChanges an XML data stream on the fly to specify a new encoding data is a raw sequence of bytes (not Unicode) that is presumed to be in %encoding already encoding is a string recognized by encodings.aliases s%entering _toUTF8, trying encoding %s iisRsstripping BOM sutf-16bestrying utf-16be instead ssutf-16lestrying utf-16le instead issutf-8strying utf-8 instead Rsutf-32bestrying utf-32be instead ssutf-32lestrying utf-32le instead s*successfully converted %s data to unicode s^<\?xml[^>]*?>s&u ( RRRRRR1RsR8RR|R(R Rtnewdatat declmatchtnewdecl((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt_toUTF8 s\8 8    cCstidti}|id|}tidti}|i|}|o |dpd}|iido d}nd}|id|}||fS(sStrips DOCTYPE from XML document, returns (rss_version, stripped_data) rss_version may be 'rss091n' or None stripped_data is the same XML document, minus the DOCTYPE s]*?)>Rs]*?)>itnetscapeRN(RsR8t MULTILINER|RRRRl(R tentity_patterntdoctype_patterntdoctype_resultstdoctypeR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyt _stripDoctype s cCst}t|dy0d"}|i|t||}d}}WqqXn| oKd#|jo>y0d#}|i|t||}d}}WqiqiXn|p:d|dtj oh} t2o4d*d+k3}|i4|i5t6i7i8d,nd|d<|i9p| |dXn|p1t:|||od"pd}|i;|n|i<|d<|i=|d<|dp|i>|d<|i?|d-<|S(.s0Parse a feed from a URL, file, stream, or stringR/R1iRitbozo_exceptionRRscontent-encodingRtfileobjRRtETagR#s Last-ModifiedR>R=R<iRR:Rs content-types%s is not an XML media typesno Content-type specifiedRscontent-locationscontent-languagei0s1The feed has not changed since you last checked, s:so the server sent no data. This is a feature, not a bug!t debug_messagesutf-8s windows-1252s#document encoding unknown, I tried s2%s, %s, utf-8, and windows-1252 but nothing workeds+documented declared as %s, but parsed as %st _ns_stackRs$http://www.w3.org/XML/1998/namespaceiNsxml parsing failed R(@R.t_XML_AVAILABLERSRTt InstanceTypeR0RRRlRaRRRRtGzipFileR!Rt decompresst MAX_WBITSRt getheaderRR=RR-R:RRVRRRRtchardettdetectRRRRRt make_parsertPREFERRED_XML_PARSERSt setFeatureRtfeature_namespacestsetContentHandlertsetErrorHandlert xmlreadert InputSourcet setByteStreamRtparseRt tracebackt print_stackt print_excRRRRRER/RR1RR(R"R#R>R$R%R&tresulttfR RRt last_modifiedRRRRRt bozo_messageRRtuse_strict_parsertknown_encodingttried_encodingstproposed_encodingt feedparsert saxparserRR((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pyR s(       #"  #    "                      t__main__(tpprint(t__doc__t __version__t __license__t __author__t__contributors__RRRRRRR1RsRR3R}RJRRTRRRt cStringIORR!RRlRtxml.saxRRRtxml.sax.saxutilsRR RR"R(tcjkcodecs.aliasest cjkcodecst iconv_codecRtchardet.constantst constantsRRRRRRR8ttagfindtspecialtcharreftSUPPORTED_VERSIONSR-R(t NameErrorR.RoRpRzRR2R{RRRRRR2R%RERFR.R^R0tHTTPDigestAuthHandlerRtHTTPDefaultErrorHandlerRR0R1R4t _iso8601_tmplRYttmplRt _iso8601_reRtregexR5RHRUt _korean_yeart _korean_montht _korean_dayt _korean_amR]RWR\RZR_R`RaReRdRcRhRjRiRkRXRft_additional_timezonest _timezonesRmRRRRRRtargvtexitturlsRR=R(((s8/home/mrben/misterben.org.uk/planet/planet/feedparser.pys s                              K   @&Hx' 5 '%6 Z     n- N                                                  ]  3   5