Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: third_party/readability/js/readability.js

Issue 176083002: Use boilerpipe-based dom-distiller-js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add OWNERS for components/resources Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/dom_distiller_js/update_domdistiller_js.sh ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Local modifications to this file are described in the README.chromium 5 // Local modifications to this file are described in the README.chromium
6 // file. 6 // file.
7 7
8 var dbg = (typeof console !== 'undefined') ? function(s) { 8 var dbg = (typeof console !== 'undefined') ? function(s) {
9 console.log("Readability: " + s); 9 console.log("Readability: " + s);
10 } : function() {}; 10 } : function() {};
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 // Returns the distilled article HTML from the page(s). 1729 // Returns the distilled article HTML from the page(s).
1730 getDistilledArticleHTML : function() { 1730 getDistilledArticleHTML : function() {
1731 return readability.distilledHTML; 1731 return readability.distilledHTML;
1732 }, 1732 },
1733 1733
1734 // Returns the next page of this article. 1734 // Returns the next page of this article.
1735 getNextPageLink : function() { 1735 getNextPageLink : function() {
1736 return readability.nextPageLink; 1736 return readability.nextPageLink;
1737 } 1737 }
1738 }; 1738 };
1739
1740 // Extracts long-form content from a page and returns and array where the first
1741 // element is the article title, the second element is HTML containing the
1742 // long-form content, and remaining elements are URLs for images referenced by
1743 // that HTML. Each <img> tag in the HTML has an id field set to k - 2, which
1744 // corresponds to a URL listed at index k in the array returned.
1745 (function () {
1746 readability.init();
1747 var result = new Array(4);
1748 result[0] = readability.getArticleTitle();
1749 result[1] = readability.getDistilledArticleHTML();
1750 result[2] = readability.getNextPageLink();
1751 // TODO(shashishekhar): Add actual previous page link here.
1752 result[3] = '';
1753 return result.concat(readability.getImages());
1754 }())
1755
OLDNEW
« no previous file with comments | « third_party/dom_distiller_js/update_domdistiller_js.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698