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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? feed-parser.js

?? 現(xiàn)在很火的郵件客戶端軟件thunderbird的源碼
?? JS
?? 第 1 頁 / 共 2 頁
字號(hào):
/* -*- 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)    {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂精品在线观看| 91激情五月电影| 欧美主播一区二区三区美女| 日韩主播视频在线| 久久这里只有精品首页| 色综合久久综合| 久久精品久久99精品久久| 亚洲摸摸操操av| 国产亚洲制服色| 69久久99精品久久久久婷婷| 福利电影一区二区三区| 日产欧产美韩系列久久99| 国产精品久久久久三级| 日韩精品一区二区三区swag| 日本精品一区二区三区四区的功能| 国精产品一区一区三区mba视频| 亚洲成人动漫在线免费观看| 国产精品色呦呦| 26uuu另类欧美| 日韩亚洲欧美综合| 精品视频一区二区不卡| 97久久精品人人爽人人爽蜜臀| 国产自产视频一区二区三区| 丝袜亚洲精品中文字幕一区| 一区二区三区在线免费视频| 中文字幕在线播放不卡一区| 久久久国际精品| 欧美一级日韩不卡播放免费| 欧美日韩一区二区三区高清| 在线视频国内自拍亚洲视频| 色综合久久中文综合久久牛| av亚洲精华国产精华精华| 成人免费va视频| 成人一级片网址| 粉嫩av一区二区三区| 国产激情一区二区三区| 激情综合网av| 国产一区二区三区| 国产露脸91国语对白| 国产美女精品人人做人人爽| 日本不卡一二三| 麻豆免费精品视频| 九色综合国产一区二区三区| 免费精品视频最新在线| 日本aⅴ免费视频一区二区三区| 天天操天天干天天综合网| 午夜视频一区二区三区| 无码av免费一区二区三区试看| 亚洲成人精品在线观看| 亚洲高清免费一级二级三级| 亚洲午夜日本在线观看| 亚洲超碰精品一区二区| 无码av中文一区二区三区桃花岛| 日韩中文字幕1| 蜜桃av一区二区在线观看| 久久精品72免费观看| 国产一级精品在线| av在线不卡免费看| 精品视频在线免费看| 欧美乱熟臀69xxxxxx| 91精品国产欧美一区二区成人 | 亚洲高清免费视频| 亚洲高清视频的网址| 日韩中文字幕亚洲一区二区va在线| 日韩二区三区四区| 精品亚洲免费视频| 国产999精品久久| 99re这里只有精品视频首页| 色老汉一区二区三区| 欧美老肥妇做.爰bbww视频| 日韩欧美亚洲一区二区| 国产日韩欧美综合一区| 综合色天天鬼久久鬼色| 亚洲成人你懂的| 国产麻豆精品95视频| av福利精品导航| 欧美日韩视频在线观看一区二区三区| 欧美欧美午夜aⅴ在线观看| 欧美精品一区二区三区蜜桃| 国产欧美日韩在线看| 亚洲精品视频免费看| 秋霞午夜av一区二区三区| 国产麻豆精品视频| 欧美日韩精品欧美日韩精品 | 欧美天天综合网| 久久婷婷综合激情| 一区二区视频在线看| 老司机精品视频导航| 99国产精品久| 精品久久人人做人人爽| 亚洲欧美成aⅴ人在线观看| 美女网站色91| 一本久久a久久免费精品不卡| 日韩欧美电影在线| 有码一区二区三区| 国产一区在线看| 欧美日免费三级在线| 日本一区二区免费在线| 天堂蜜桃一区二区三区 | 不卡一区二区在线| 91精品综合久久久久久| 亚洲精品一二三区| 国产一区不卡在线| 欧美一区二区免费视频| 亚洲精品写真福利| 国产成人a级片| 精品国产91九色蝌蚪| 午夜激情一区二区三区| 97se狠狠狠综合亚洲狠狠| 久久久久99精品国产片| 天天爽夜夜爽夜夜爽精品视频| 91视频你懂的| 中文字幕av一区 二区| 免费成人av在线播放| 欧美性极品少妇| 国产精品久久久久久一区二区三区| 精东粉嫩av免费一区二区三区| 精品视频一区二区不卡| 亚洲另类在线视频| 成人高清伦理免费影院在线观看| 久久色成人在线| 看电视剧不卡顿的网站| 欧美一级高清大全免费观看| 一区二区在线观看免费视频播放| gogo大胆日本视频一区| 国产女主播一区| 国产美女娇喘av呻吟久久| 精品国产区一区| 裸体在线国模精品偷拍| 日韩欧美国产精品| 免费人成精品欧美精品| 欧美一区二区视频免费观看| 午夜精品福利一区二区三区av| 色偷偷一区二区三区| 亚洲色图在线看| 色综合久久综合| 亚洲成人高清在线| 777午夜精品免费视频| 日韩精品久久久久久| 欧美日韩国产一区| 五月天视频一区| 91精品国产乱| 精品一区二区三区日韩| 欧美mv和日韩mv的网站| 日本vs亚洲vs韩国一区三区二区| 欧美一区二区三区不卡| 日本视频一区二区| 欧美成人三级在线| 国产美女在线精品| 中文久久乱码一区二区| 99精品欧美一区| 亚洲国产另类av| 91精品国产麻豆国产自产在线| 激情都市一区二区| 国产精品全国免费观看高清| 波多野结衣在线一区| 一区二区三区国产豹纹内裤在线 | 国产日韩欧美a| 不卡大黄网站免费看| 亚洲一区二区三区四区在线免费观看| 欧美唯美清纯偷拍| 狠狠色狠狠色综合| |精品福利一区二区三区| 欧美丝袜丝交足nylons| 日本三级韩国三级欧美三级| 国产欧美日本一区二区三区| 日本道精品一区二区三区| 日韩精品视频网| 中文字幕不卡一区| 欧美日韩美少妇| 国产成人av电影| 亚洲一区二区三区自拍| 久久久久97国产精华液好用吗| 色综合天天视频在线观看 | 国产一区91精品张津瑜| 亚洲欧美激情在线| 欧美成人一区二区三区片免费 | 日韩一二三四区| 99久久精品国产网站| 日韩经典中文字幕一区| 国产亚洲人成网站| 欧美日韩一区二区在线视频| 国产综合成人久久大片91| 一级做a爱片久久| 久久精品亚洲麻豆av一区二区| 欧美中文字幕一区二区三区 | 亚洲欧美一区二区三区极速播放| 91精品免费在线观看| 不卡的av在线播放| 麻豆国产欧美日韩综合精品二区 | 成人av资源站| 久久er精品视频| 亚洲一区视频在线观看视频| 久久久国产午夜精品| 欧美人成免费网站| 97精品国产97久久久久久久久久久久| 久久se精品一区二区| 亚洲第一狼人社区| 亚洲欧美一区二区三区久本道91 | av欧美精品.com|