亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? feed-parser.js

?? 現(xiàn)在很火的郵件客戶端軟件thunderbird的源碼
?? JS
?? 第 1 頁 / 共 2 頁
字號:
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the RSS Parsing Engine * * The Initial Developer of the Original Code is * The Mozilla Foundation. * Portions created by the Initial Developer are Copyright (C) 2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the  * ***** END LICENSE BLOCK ***** */// The feed parser depends on FeedItems.js, Feed.js.var rdfcontainer =  Components.classes["@mozilla.org/rdf/container-utils;1"].getService(Components.interfaces.nsIRDFContainerUtils);var rdfparser = Components.classes["@mozilla.org/rdf/xml-parser;1"].createInstance(Components.interfaces.nsIRDFXMLParser);var serializer = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"].createInstance(Components.interfaces.nsIDOMSerializer);function FeedParser() {}FeedParser.prototype = {  // parseFeed returns an array of parsed items ready for processing  // it is currently a synchronous operation. If there was an error parsing the feed,   // parseFeed returns an empty feed in addition to calling aFeed.onParseError  parseFeed: function (aFeed, aSource, aDOM, aBaseURI)  {    if (!aSource || !(aDOM instanceof Components.interfaces.nsIDOMXMLDocument))    {      aFeed.onParseError(aFeed);         return new Array();    }    else if((aDOM.documentElement.namespaceURI == "http://www.w3.org/1999/02/22-rdf-syntax-ns#")            && (aDOM.documentElement.getElementsByTagNameNS("http://purl.org/rss/1.0/", "channel")[0]))    {      debug(aFeed.url + " is an RSS 1.x (RDF-based) feed");      // aSource can be misencoded (XMLHttpRequest converts to UTF-8 by default),       // but the DOM is almost always right because it uses the hints in the XML file.      // This is slower, but not noticably so. Mozilla doesn't have the       // XMLHttpRequest.responseBody property that IE has, which provides access       // to the unencoded response.      var xmlString=serializer.serializeToString(aDOM.documentElement);      return this.parseAsRSS1(aFeed, xmlString, aBaseURI);    }    else if (aDOM.documentElement.namespaceURI == ATOM_03_NS)    {      debug(aFeed.url + " is an Atom 0.3 feed");      return this.parseAsAtom(aFeed, aDOM);    }    else if (aDOM.documentElement.namespaceURI == ATOM_IETF_NS)    {      debug(aFeed.url + " is an IETF Atom feed");      return this.parseAsAtomIETF(aFeed, aDOM);    }    else if (aSource.search(/"http:\/\/my\.netscape\.com\/rdf\/simple\/0\.9\/"/) != -1)    {      debug(aFeed.url + " is an 0.90 feed");      return this.parseAsRSS2(aFeed, aDOM);    }    // XXX Explicitly check for RSS 2.0 instead of letting it be handled by the    // default behavior (who knows, we may change the default at some point).    else     {      // We don't know what kind of feed this is; let's pretend it's RSS 0.9x      // and hope things work out for the best.  In theory even RSS 1.0 feeds      // could be parsed by the 0.9x parser if the RSS namespace was the default.      debug(aFeed.url + " is of unknown format; assuming an RSS 0.9x feed");      return this.parseAsRSS2(aFeed, aDOM);    }  },  parseAsRSS2: function (aFeed, aDOM)   {    // Get the first channel (assuming there is only one per RSS File).    var parsedItems = new Array();    var channel = aDOM.getElementsByTagName("channel")[0];    if (!channel)      return aFeed.onParseError(aFeed);    //usually the empty string, unless this is RSS .90    var nsURI = channel.namespaceURI || "";    debug("channel NS: '" + nsURI +"'");    aFeed.title = aFeed.title || getNodeValue(this.childrenByTagNameNS(channel, nsURI, "title")[0]);    aFeed.description = getNodeValue(this.childrenByTagNameNS(channel, nsURI, "description")[0]);    aFeed.link = getNodeValue(this.childrenByTagNameNS(channel, nsURI, "link")[0]);    if (!aFeed.parseItems)      return parsedItems;    aFeed.invalidateItems();    // XXX use getElementsByTagNameNS for now    // childrenByTagNameNS would be better, but RSS .90 is still with us    var itemNodes = aDOM.getElementsByTagNameNS(nsURI,"item");    for (var i=0; i < itemNodes.length; i++)     {      var itemNode = itemNodes[i];      var item = new FeedItem();      item.feed = aFeed;      item.characterSet = "UTF-8";      var link = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "link")[0]);      var guidNode = this.childrenByTagNameNS(itemNode, nsURI, "guid")[0];      var guid;      var isPermaLink;      if (guidNode)       {        guid = getNodeValue(guidNode);        isPermaLink = guidNode.getAttribute('isPermaLink') == 'false' ? false : true;      }      item.isStoredWithId = true;      item.url = link ? link : (guid && isPermaLink) ? guid : null;      item.id = guid;      item.description = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "description")[0]);      item.title = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "title")[0])                   || (item.description ? (this.stripTags(item.description).substr(0, 150)) : null)                   || item.title;      item.author = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "author")[0]                                 || this.childrenByTagNameNS(itemNode, DC_NS, "creator")[0])                                 || aFeed.title                                 || item.author;      item.date = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "pubDate")[0]                               || this.childrenByTagNameNS(itemNode, DC_NS, "date")[0])                               || item.date;          // If the date is invalid, users will see the beginning of the epoch      // unless we reset it here, so they'll see the current time instead.      // This is typical aggregator behavior.      if(item.date)      {        item.date = trimString(item.date);        if(!isValidRFC822Date(item.date))        {          // XXX Use this on the other formats as well          item.date = dateRescue(item.date);        }      }      var content = getNodeValue(this.childrenByTagNameNS(itemNode, RSS_CONTENT_NS, "encoded")[0]);      if(content)        item.content = content;      // Handle an enclosure (if present)      var enclosureNode = this.childrenByTagNameNS(itemNode, nsURI, "enclosure")[0];      if (enclosureNode)        item.enclosure = new FeedEnclosure(enclosureNode.getAttribute("url"),                                           enclosureNode.getAttribute("type"),                                          enclosureNode.getAttribute("length"));      parsedItems[i] = item;    }    return parsedItems;  },  parseAsRSS1 : function(aFeed, aSource, aBaseURI)   {    var parsedItems = new Array();    // RSS 1.0 is valid RDF, so use the RDF parser/service to extract data.    // Create a new RDF data source and parse the feed into it.    var ds = Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"]             .createInstance(Components.interfaces.nsIRDFDataSource);    rdfparser.parseString(ds, aBaseURI, aSource);        // Get information about the feed as a whole.    var channel = ds.GetSource(RDF_TYPE, RSS_CHANNEL, true);        aFeed.title = aFeed.title || getRDFTargetValue(ds, channel, RSS_TITLE) || aFeed.url;    aFeed.description = getRDFTargetValue(ds, channel, RSS_DESCRIPTION) || "";    aFeed.link = getRDFTargetValue(ds, channel, RSS_LINK) || aFeed.url;    if (!aFeed.parseItems)      return parsedItems;    aFeed.invalidateItems();    var items = ds.GetTarget(channel, RSS_ITEMS, true);    if (items)      items = rdfcontainer.MakeSeq(ds, items).GetElements();      // If the channel doesn't list any items, look for resources of type "item"    // (a hacky workaround for some buggy feeds).    if (!items || !items.hasMoreElements())      items = ds.GetSources(RDF_TYPE, RSS_ITEM, true);    var index = 0;     while (items.hasMoreElements())     {      var itemResource = items.getNext().QueryInterface(Components.interfaces.nsIRDFResource);      var item = new FeedItem();      item.feed = aFeed;      item.characterSet = "UTF-8";      // Prefer the value of the link tag to the item URI since the URI could be      // a relative URN.      var uri = itemResource.Value;      var link = getRDFTargetValue(ds, itemResource, RSS_LINK);      // XXX      // check for bug258465 -- entities appear escaped       // in the value returned by getRDFTargetValue when they shouldn't      //debug("link comparison\n" + " uri: " + uri + "\nlink: " + link);      item.url = link || uri;      item.id = item.url;      item.description = getRDFTargetValue(ds, itemResource, RSS_DESCRIPTION);      item.title = getRDFTargetValue(ds, itemResource, RSS_TITLE)                                     || getRDFTargetValue(ds, itemResource, DC_SUBJECT)                                     || (item.description ? (this.stripTags(item.description).substr(0, 150)) : null)                                     || item.title;      item.author = getRDFTargetValue(ds, itemResource, DC_CREATOR)                                      || getRDFTargetValue(ds, channel, DC_CREATOR)                                      || aFeed.title                                      || item.author;            item.date = getRDFTargetValue(ds, itemResource, DC_DATE) || item.date;      item.content = getRDFTargetValue(ds, itemResource, RSS_CONTENT_ENCODED);      parsedItems[index++] = item;    }      return parsedItems;  },  parseAsAtom: function(aFeed, aDOM)   {    var parsedItems = new Array();    // Get the first channel (assuming there is only one per Atom File).    var channel = aDOM.getElementsByTagName("feed")[0];    if (!channel)    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲黄色性网站| 国产经典欧美精品| 国产在线精品一区二区三区不卡 | 99久久精品情趣| 欧美丰满高潮xxxx喷水动漫 | 欧美精品成人一区二区三区四区| 精品福利一二区| 亚洲一区二区成人在线观看| 国产精品66部| 91精品国产综合久久精品app| 亚洲特级片在线| 国产成人av一区二区三区在线 | 免费视频最近日韩| 色综合激情五月| 国产精品国产三级国产普通话三级 | 精品国产自在久精品国产| 青青青爽久久午夜综合久久午夜| 成人性生交大片免费看在线播放 | 91美女视频网站| 久久色在线观看| 麻豆国产欧美日韩综合精品二区| 色综合久久精品| 亚洲日本中文字幕区| 粉嫩绯色av一区二区在线观看| 日韩久久免费av| 日韩av中文在线观看| 欧美日韩一级片网站| 亚洲精品免费播放| 色综合久久综合网欧美综合网| 中文字幕不卡在线| 盗摄精品av一区二区三区| 久久久精品2019中文字幕之3| 久久成人久久爱| 精品国产乱码久久久久久蜜臀| 奇米色777欧美一区二区| 日韩一区和二区| 美女视频免费一区| 精品欧美一区二区久久| 韩国av一区二区三区在线观看| 精品裸体舞一区二区三区| 国产自产2019最新不卡| 国产亚洲精品久| 成人自拍视频在线观看| 国产精品不卡一区二区三区| 99久久99精品久久久久久 | 免费在线观看成人| 日韩一区和二区| 国产一区二区三区| 国产精品久久久久久久久免费丝袜 | 久久99久久久久久久久久久| 欧美mv日韩mv国产| 国产成人av一区二区| 成人欧美一区二区三区小说 | 成人精品视频一区二区三区| 综合分类小说区另类春色亚洲小说欧美| 99久久精品国产精品久久| 一区二区三区丝袜| 日韩一区二区三区视频在线| 国产精品1区二区.| 亚洲精品久久久蜜桃| 欧美日本一区二区| 国产福利精品一区| 中文字幕第一页久久| 欧美在线|欧美| 久久成人免费电影| 一区二区三区四区精品在线视频| 777午夜精品视频在线播放| 国产一区二区美女诱惑| 亚洲精品国产精品乱码不99| 日韩视频免费观看高清在线视频| 成人午夜av影视| 水野朝阳av一区二区三区| 国产日韩影视精品| 欧美日韩精品一二三区| 国产成人精品午夜视频免费| 亚洲国产视频一区二区| 久久久久久久久久久久久夜| 欧美色倩网站大全免费| 国产成a人亚洲| 日本中文一区二区三区| 亚洲欧美怡红院| 久久亚洲精华国产精华液| 欧美日韩国产另类一区| 99久久国产免费看| 久久99国产精品免费| 亚洲一卡二卡三卡四卡五卡| 欧美激情综合网| 日韩一区二区免费在线电影| 91免费看片在线观看| 国产在线视视频有精品| 亚洲国产精品自拍| 亚洲女人小视频在线观看| 久久婷婷国产综合精品青草| 欧美精品xxxxbbbb| 欧美性色黄大片| 91污在线观看| yourporn久久国产精品| 国产精品一级黄| 琪琪久久久久日韩精品| 日日夜夜精品视频免费| 亚洲午夜在线视频| 一区二区欧美在线观看| 国产精品第13页| 中文字幕av不卡| 亚洲精品在线免费观看视频| 91.com在线观看| 51午夜精品国产| 欧美喷潮久久久xxxxx| 欧美视频中文一区二区三区在线观看| 99亚偷拍自图区亚洲| 97se亚洲国产综合自在线观| 丁香一区二区三区| 成人在线综合网| 国产69精品久久久久毛片| 国产精品亚洲专一区二区三区 | 色综合亚洲欧洲| 成av人片一区二区| 99久久99久久精品国产片果冻| 99久精品国产| 91丨国产丨九色丨pron| 色拍拍在线精品视频8848| 日本高清不卡在线观看| 欧美精选一区二区| 欧美一级搡bbbb搡bbbb| 欧美电影免费观看高清完整版在线观看| 91精品在线免费| 日韩欧美亚洲国产另类| 欧美xxxxxxxx| 国产欧美日韩在线视频| 亚洲免费视频中文字幕| 亚洲精品综合在线| 亚洲一区二区av在线| 久久av老司机精品网站导航| 国产美女精品在线| 北条麻妃国产九九精品视频| 欧美综合欧美视频| 91麻豆精品国产91久久久久久久久| 日韩欧美二区三区| 亚洲国产岛国毛片在线| 伊人一区二区三区| 美女爽到高潮91| 成人黄色一级视频| 欧美性受xxxx黑人xyx| 精品国产成人系列| 亚洲特黄一级片| 日本人妖一区二区| 国产麻豆视频精品| 色综合久久久久久久久| 欧美成人精品3d动漫h| 国产精品免费人成网站| 亚洲福利一区二区| 国产伦理精品不卡| 在线视频你懂得一区| 欧美精品一区二区三区蜜桃| 亚洲色图一区二区| 国模套图日韩精品一区二区 | 欧美一级欧美三级在线观看| 久久精品免费在线观看| 亚洲免费观看高清完整版在线| 日韩不卡免费视频| 9i在线看片成人免费| 日韩午夜在线播放| 国产精品国产三级国产aⅴ中文| 石原莉奈在线亚洲二区| 成人免费观看男女羞羞视频| 欧美精品 日韩| 亚洲少妇30p| 国产乱淫av一区二区三区| 在线免费视频一区二区| 国产日韩欧美麻豆| 日韩精品一二三区| 一本色道亚洲精品aⅴ| 精品国产伦一区二区三区免费| 亚洲精品欧美激情| 成人av动漫在线| 2017欧美狠狠色| 日本色综合中文字幕| 欧洲av在线精品| 日本一区二区三区久久久久久久久不| 婷婷综合另类小说色区| 94-欧美-setu| 国产欧美一区二区精品久导航 | 久久九九国产精品| 日韩精品一级中文字幕精品视频免费观看| 99免费精品在线| 国产女同性恋一区二区| 精品一二三四区| 日韩一区二区在线看片| 日韩电影一区二区三区四区| 欧美伊人久久久久久午夜久久久久| 自拍偷拍亚洲欧美日韩| 成人av在线电影| 亚洲国产成人午夜在线一区 | 国产精品沙发午睡系列990531| 麻豆传媒一区二区三区| 欧美一区二区三区公司| 日日夜夜一区二区| 欧美一卡二卡三卡| 免费成人在线影院| 日韩欧美国产高清|