first commit
This commit is contained in:
3
build/node_modules/feed/.babelrc
generated
vendored
Normal file
3
build/node_modules/feed/.babelrc
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["env"]
|
||||
}
|
||||
2
build/node_modules/feed/.npmignore
generated
vendored
Normal file
2
build/node_modules/feed/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
coverage
|
||||
node_modules
|
||||
13
build/node_modules/feed/.travis.yml
generated
vendored
Normal file
13
build/node_modules/feed/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "7"
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
before_install:
|
||||
- export TZ=Europe/London
|
||||
script:
|
||||
- "npm run-script test-travis"
|
||||
after_script:
|
||||
- "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
|
||||
- "codeclimate-test-reporter < ./coverage/lcov.info"
|
||||
1
build/node_modules/feed/AUTHORS
generated
vendored
Executable file
1
build/node_modules/feed/AUTHORS
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
Jean-Philippe Monette <contact@jpmonette.net> (http://blogue.jpmonette.net/)
|
||||
7
build/node_modules/feed/LICENSE
generated
vendored
Executable file
7
build/node_modules/feed/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
Copyright (C) 2013, Jean-Philippe Monette <contact@jpmonette.net>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
138
build/node_modules/feed/README.md
generated
vendored
Executable file
138
build/node_modules/feed/README.md
generated
vendored
Executable file
@@ -0,0 +1,138 @@
|
||||
# Feed for Node.js
|
||||
|
||||
> [Feed](http://projets.jpmonette.net/en/feed) is a *RSS 2.0*, *JSON Feed 1.0*, and *Atom 1.0* generator for **Node.js**, making content syndication simple and intuitive!
|
||||
|
||||
[](https://travis-ci.org/jpmonette/feed)
|
||||
[](https://coveralls.io/github/jpmonette/feed?branch=master)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install feed
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* Pure JavaScript
|
||||
* Support for Atom 1.0 and RSS 2.0
|
||||
* Lightweight - Only 1 dependency!
|
||||
|
||||
## Quick Start
|
||||
|
||||
First, add the module:
|
||||
|
||||
```js
|
||||
const Feed = require('feed')
|
||||
```
|
||||
|
||||
Insert feed-specific information:
|
||||
|
||||
```js
|
||||
let feed = new Feed({
|
||||
title: 'Feed Title',
|
||||
description: 'This is my personal feed!',
|
||||
id: 'http://example.com/',
|
||||
link: 'http://example.com/',
|
||||
image: 'http://example.com/image.png',
|
||||
favicon: 'http://example.com/favicon.ico',
|
||||
copyright: 'All rights reserved 2013, John Doe',
|
||||
updated: new Date(2013, 06, 14), // optional, default = today
|
||||
generator: 'awesome', // optional, default = 'Feed for Node.js'
|
||||
feedLinks: {
|
||||
json: 'https://example.com/json',
|
||||
atom: 'https://example.com/atom',
|
||||
},
|
||||
author: {
|
||||
name: 'John Doe',
|
||||
email: 'johndoe@example.com',
|
||||
link: 'https://example.com/johndoe'
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Insert items using the item function:
|
||||
|
||||
```js
|
||||
posts.forEach(post => {
|
||||
feed.addItem({
|
||||
title: post.title,
|
||||
id: post.url,
|
||||
link: post.url,
|
||||
description: post.description,
|
||||
content: post.content,
|
||||
author: [{
|
||||
name: 'Jane Doe',
|
||||
email: 'janedoe@example.com',
|
||||
link: 'https://example.com/janedoe'
|
||||
}, {
|
||||
name: 'Joe Smith',
|
||||
email: 'joesmith@example.com',
|
||||
link: 'https://example.com/joesmith'
|
||||
}],
|
||||
contributor: [{
|
||||
name: 'Shawn Kemp',
|
||||
email: 'shawnkemp@example.com',
|
||||
link: 'https://example.com/shawnkemp'
|
||||
}, {
|
||||
name: 'Reggie Miller',
|
||||
email: 'reggiemiller@example.com',
|
||||
link: 'https://example.com/reggiemiller'
|
||||
}],
|
||||
date: post.date,
|
||||
image: post.image
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
Insert categories using:
|
||||
|
||||
```js
|
||||
feed.addCategory('Technologie')
|
||||
```
|
||||
|
||||
Insert contributors using:
|
||||
|
||||
```js
|
||||
feed.addContributor({
|
||||
name: 'Johan Cruyff',
|
||||
email: 'johancruyff@example.com',
|
||||
link: 'https://example.com/johancruyff'
|
||||
})
|
||||
```
|
||||
|
||||
Output a RSS 2.0 feed:
|
||||
|
||||
```js
|
||||
feed.rss2()
|
||||
```
|
||||
|
||||
Output an Atom 1.0 feed:
|
||||
|
||||
```js
|
||||
feed.atom1()
|
||||
```
|
||||
|
||||
Output a JSON Feed 1.0 feed:
|
||||
|
||||
```js
|
||||
feed.json1()
|
||||
```
|
||||
|
||||
Yes, it's that simple :)!
|
||||
|
||||
## More Information
|
||||
|
||||
* [Feed for Node.js](http://projets.jpmonette.net/en/feed) (English)
|
||||
* [Feed pour Node.js](http://projets.jpmonette.net/feed) (French)
|
||||
* Follow [@jpmonette](https://twitter.com/jpmonette) on Twitter for updates
|
||||
* Read my personal blog [Blogue de Jean-Philippe Monette](http://blogue.jpmonette.net/) to learn more about what I do!
|
||||
|
||||
## License
|
||||
|
||||
Copyright (C) 2013, Jean-Philippe Monette <contact@jpmonette.net>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
45
build/node_modules/feed/examples/sample.js
generated
vendored
Normal file
45
build/node_modules/feed/examples/sample.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
const Feed = require('../lib/feed')
|
||||
|
||||
var feed = new Feed({
|
||||
title: 'Feed Title',
|
||||
description: 'This is my personnal feed!',
|
||||
id: 'fake',
|
||||
link: 'http://example.com/',
|
||||
image: 'http://example.com/image.png',
|
||||
copyright: 'All rights reserved 2013, John Doe',
|
||||
|
||||
author: {
|
||||
name: 'John Doe',
|
||||
email: 'johndoe@example.com',
|
||||
link: 'https://example.com/johndoe'
|
||||
}
|
||||
});
|
||||
|
||||
feed.addItem({
|
||||
title: 'Title #1',
|
||||
id: 'https://id',
|
||||
link: 'https://url',
|
||||
description: '#1 description',
|
||||
author: [{
|
||||
name: 'Jane Doe',
|
||||
email: 'janedoe@example.com',
|
||||
link: 'https://example.com/janedoe'
|
||||
}, {
|
||||
name: 'Joe Smith',
|
||||
email: 'joesmith@example.com',
|
||||
link: 'https://example.com/joesmith'
|
||||
}],
|
||||
contributor: [{
|
||||
name: 'Shawn Kemp',
|
||||
email: 'shawnkemp@example.com',
|
||||
link: 'https://example.com/shawnkemp'
|
||||
}, {
|
||||
name: 'Reggie Miller',
|
||||
email: 'reggiemiller@example.com',
|
||||
link: 'https://example.com/reggiemiller'
|
||||
}],
|
||||
date: new Date(),
|
||||
image: 'test.png'
|
||||
});
|
||||
|
||||
console.log(feed.atom1())
|
||||
8
build/node_modules/feed/feed.sublime-project
generated
vendored
Normal file
8
build/node_modules/feed/feed.sublime-project
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders":
|
||||
[
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
]
|
||||
}
|
||||
608
build/node_modules/feed/feed.sublime-workspace
generated
vendored
Normal file
608
build/node_modules/feed/feed.sublime-workspace
generated
vendored
Normal file
@@ -0,0 +1,608 @@
|
||||
{
|
||||
"auto_complete":
|
||||
{
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"field",
|
||||
"fieldValue"
|
||||
],
|
||||
[
|
||||
"Compar",
|
||||
"ComparisonOperator"
|
||||
],
|
||||
[
|
||||
"build",
|
||||
"buildOrderBy"
|
||||
],
|
||||
[
|
||||
"nulls",
|
||||
"nullsOrder"
|
||||
],
|
||||
[
|
||||
"SObjc",
|
||||
"SObjectType"
|
||||
],
|
||||
[
|
||||
"order",
|
||||
"orderType"
|
||||
],
|
||||
[
|
||||
"Order",
|
||||
"OrderBy"
|
||||
],
|
||||
[
|
||||
"sty",
|
||||
"standardStylesheets\t(Boolean)"
|
||||
],
|
||||
[
|
||||
"show",
|
||||
"showHeader\t(Boolean)"
|
||||
]
|
||||
]
|
||||
},
|
||||
"buffers":
|
||||
[
|
||||
{
|
||||
"file": "package.json",
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 1491,
|
||||
"line_ending": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"contents": "# Changelog\n\n- Migrate to Babel\n- Migrate to Jest\n- Increased code coverage\n- Deprecate `render()` function",
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 107,
|
||||
"line_ending": "Unix",
|
||||
"name": "# Changelog"
|
||||
}
|
||||
},
|
||||
{
|
||||
"file": "coverage/lcov.info",
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 4717,
|
||||
"encoding": "UTF-8",
|
||||
"line_ending": "Unix"
|
||||
}
|
||||
}
|
||||
],
|
||||
"build_system": "",
|
||||
"build_system_choices":
|
||||
[
|
||||
],
|
||||
"build_varint": "",
|
||||
"command_palette":
|
||||
{
|
||||
"height": 163.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"apex",
|
||||
"Set Syntax: Apex"
|
||||
],
|
||||
[
|
||||
"syntax sql",
|
||||
"Set Syntax: SQL"
|
||||
],
|
||||
[
|
||||
"trim",
|
||||
"Trimmer: Trim trailing whitespace."
|
||||
],
|
||||
[
|
||||
"coverage",
|
||||
"MavensMate: Get Apex Code Coverage For This Apex Class"
|
||||
],
|
||||
[
|
||||
"trim trail",
|
||||
"Trimmer: Trim trailing whitespace."
|
||||
],
|
||||
[
|
||||
"apexcl",
|
||||
"MavensMate: New Apex Class"
|
||||
],
|
||||
[
|
||||
"tests",
|
||||
"MavensMate: Run All Tests"
|
||||
],
|
||||
[
|
||||
"trailin",
|
||||
"Trimmer: Trim trailing whitespace."
|
||||
],
|
||||
[
|
||||
"apex ",
|
||||
"MavensMate: New Apex Class"
|
||||
],
|
||||
[
|
||||
"trailing",
|
||||
"Trimmer: Trim trailing whitespace."
|
||||
],
|
||||
[
|
||||
"gitn",
|
||||
"Gitignore: New gitignore"
|
||||
],
|
||||
[
|
||||
"scheme",
|
||||
"ColorSchemeSelector: Select Color Scheme"
|
||||
],
|
||||
[
|
||||
"trigger",
|
||||
"MavensMate: New Apex Trigger"
|
||||
],
|
||||
[
|
||||
"class",
|
||||
"MavensMate: New Apex Class"
|
||||
],
|
||||
[
|
||||
"visualforce",
|
||||
"MavensMate: New Visualforce Page"
|
||||
],
|
||||
[
|
||||
"markdown",
|
||||
"Set Syntax: Markdown"
|
||||
],
|
||||
[
|
||||
"visual",
|
||||
"MavensMate: New Visualforce Page"
|
||||
],
|
||||
[
|
||||
"indent",
|
||||
"Indentation: Reindent Lines"
|
||||
],
|
||||
[
|
||||
"html",
|
||||
"HTMLPrettify"
|
||||
],
|
||||
[
|
||||
"format",
|
||||
"Format: Javascript"
|
||||
],
|
||||
[
|
||||
"javasc",
|
||||
"Set Syntax: JavaScript"
|
||||
],
|
||||
[
|
||||
"apex cla",
|
||||
"MavensMate: New Apex Class"
|
||||
],
|
||||
[
|
||||
"syntax html",
|
||||
"Set Syntax: HTML"
|
||||
],
|
||||
[
|
||||
"default",
|
||||
"Preferences: Settings - Default"
|
||||
],
|
||||
[
|
||||
"user",
|
||||
"Preferences: Settings - User"
|
||||
],
|
||||
[
|
||||
"terminal",
|
||||
"Preferences: Terminal Settings – Default"
|
||||
],
|
||||
[
|
||||
"install",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"Package Control: ",
|
||||
"Package Control: Install Package"
|
||||
]
|
||||
],
|
||||
"width": 462.0
|
||||
},
|
||||
"console":
|
||||
{
|
||||
"height": 126.0,
|
||||
"history":
|
||||
[
|
||||
"import urllib.request,os,hashlib; h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)"
|
||||
]
|
||||
},
|
||||
"distraction_free":
|
||||
{
|
||||
"menu_visible": true,
|
||||
"show_minimap": false,
|
||||
"show_open_files": false,
|
||||
"show_tabs": false,
|
||||
"side_bar_visible": false,
|
||||
"status_bar_visible": false
|
||||
},
|
||||
"expanded_folders":
|
||||
[
|
||||
"/Users/mavens/Documents/Workspaces/js/feed",
|
||||
"/Users/mavens/Documents/Workspaces/js/feed/coverage",
|
||||
"/Users/mavens/Documents/Workspaces/js/feed/examples"
|
||||
],
|
||||
"file_history":
|
||||
[
|
||||
"/Users/mavens/Documents/Workspaces/js/feed/.travis.yml",
|
||||
"/Users/mavens/Documents/Workspaces/js/feed/.gitignore",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/coverage/lcov.info",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/QCondition.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/package.xml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/build.xml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/QTest.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/Q.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/QOrderTest.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/QConditionTest.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/src/classes/QOrder.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/circle.yml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/.gitignore",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/README.md",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/.coveralls.yml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/.travis.yml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/.codeclimate.yml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact+q@jpmonette.net/contact+q@jpmonette.net.sublime-project",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/Query.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/Q.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/QTest.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/.gitignore",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/README.md",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/CONTRIBUTORS",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/CONTRIBUTING.md",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/QueryTest.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/CaseNotesMVN/CaseNotesMVN.app",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/PostChatController.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/pages/PostChat.page",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/PostChatHandler.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/PreChatHandler.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/triggers/TestObjectTrigger.trigger",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/PrechatController.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/ApexStubSample.cls-meta.xml",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/ApexStubSample.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/pages/AccountTest.page",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/pages/LiveAgent_Custom_Chat_Page.page",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/pages/Prechat.page",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/TodoAppController.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/classes/Error.cls",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/contact@jpmonette.net.sublime-project",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/TodoApp/TodoAppController.js",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/TodoApp/TodoApp.app",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/TodoItems/TodoItems.cmp",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/tabs/tabs.cmp",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/TodoItem/TodoItem.cmp",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/MedicalHistoryComponentMVN/MedicalHistoryComponentMVN.cmp",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura/MedicalHistoryAppMVN/MedicalHistoryAppMVN.app",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/package.xml",
|
||||
"/Users/mavens/Documents/Workspaces/mobile/AwesomeProject/index.ios.js",
|
||||
"/Users/mavens/Documents/Workspaces/mobile/AwesomeProject/node_modules/react/lib/ReactCompositeComponent.js",
|
||||
"/Users/mavens/Documents/Workspaces/mobile/AwesomeProject/node_modules/react-native/Libraries/ReactNative/ReactNativeBaseComponent.js",
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/pages/Trailhead_SLDS_Contacts.page",
|
||||
"/Users/mavens/Downloads/biogen-status.log",
|
||||
"/Users/mavens/Downloads/seao_mars/Avis_20160301_20160331.xml",
|
||||
"/Users/mavens/Downloads/seao_mars/Depenses_20160301_20160331.xml",
|
||||
"/Users/mavens/Downloads/lexer.js",
|
||||
"/Users/mavens/Downloads/code.cls",
|
||||
"/Users/mavens/Library/Application Support/Sublime Text 3/Packages/Default/Preferences.sublime-settings",
|
||||
"/Users/mavens/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings",
|
||||
"/Users/mavens/Library/Application Support/Sublime Text 3/Packages/User/Terminal.sublime-settings",
|
||||
"/Users/mavens/Library/Application Support/Sublime Text 3/Packages/Terminal/Terminal.sublime-settings",
|
||||
"/Users/mavens/Google Drive/Organizations/Mavens/Training/2016-04-06 - Veeva Certification/CRM Certification Data Files/Pharmacy_List_Master.csv",
|
||||
"/Users/mavens/Google Drive/Organizations/Mavens/Training/2016-04-06 - Veeva Certification/CRM Certification Data Files/CertZipToTerr.csv",
|
||||
"/Users/mavens/Google Drive/Organizations/Mavens/Training/2016-04-06 - Veeva Certification/CRM Certification Data Files/Pharmacy_List_Master_Address.csv",
|
||||
"/Users/mavens/Library/Application Support/Sublime Text 3/Packages/User/mavensmate.sublime-settings",
|
||||
"/Users/mavens/Downloads/Account Export-03_31_2016-16_32_19.csv",
|
||||
"/Users/mavens/Google Drive/Organizations/Mavens/Training/2016-03-28 - Veeva Training/CRM Admin Student Material/Files for Data Loading/Territory Files/TrainZipToTerrs.csv"
|
||||
],
|
||||
"find":
|
||||
{
|
||||
"height": 48.0
|
||||
},
|
||||
"find_in_files":
|
||||
{
|
||||
"height": 136.0,
|
||||
"where_history":
|
||||
[
|
||||
"/Users/mavens/Documents/Workspaces/salesforce/contact@jpmonette.net/src/aura"
|
||||
]
|
||||
},
|
||||
"find_state":
|
||||
{
|
||||
"case_sensitive": true,
|
||||
"find_history":
|
||||
[
|
||||
"16",
|
||||
"postJson",
|
||||
"591",
|
||||
",0",
|
||||
"formatter",
|
||||
"client",
|
||||
":/",
|
||||
"./",
|
||||
"selectfields",
|
||||
"selectFields",
|
||||
"condition",
|
||||
"Program_Members",
|
||||
"Discharge Date",
|
||||
"<trackHistory>true",
|
||||
"<trackHistory>true</trackHistory>",
|
||||
"test",
|
||||
"tests",
|
||||
"build",
|
||||
"addSubquery",
|
||||
"addLimit",
|
||||
"12,",
|
||||
"toSOQL",
|
||||
"Set<String",
|
||||
"field",
|
||||
"build.cmd",
|
||||
"replace",
|
||||
"replaceSensitiveDataPlaceholdersWithEnvironmentVars",
|
||||
"condition",
|
||||
"OrderBy",
|
||||
"CONTRIBUTING.md",
|
||||
"orderBy",
|
||||
"order(",
|
||||
"toSOQL",
|
||||
"add(",
|
||||
"fromType",
|
||||
"OrderBy(",
|
||||
"qb.toSOQL()",
|
||||
"Q qb",
|
||||
"Query q",
|
||||
"q.",
|
||||
"Query",
|
||||
"\t",
|
||||
"prechat_field_name",
|
||||
"findAll",
|
||||
"slds-col--padded slds-size--1-of-1 slds-medium-size--1-of-2",
|
||||
"Test",
|
||||
"07945",
|
||||
"\"\"\"",
|
||||
",,",
|
||||
",102,",
|
||||
",101,",
|
||||
";"
|
||||
],
|
||||
"highlight": true,
|
||||
"in_selection": false,
|
||||
"preserve_case": false,
|
||||
"regex": false,
|
||||
"replace_history":
|
||||
[
|
||||
":",
|
||||
"/",
|
||||
"",
|
||||
"<trackHistory>false</trackHistory>",
|
||||
"build",
|
||||
"QOrder",
|
||||
"build",
|
||||
"query",
|
||||
"String query",
|
||||
"Q qb",
|
||||
"qb.",
|
||||
"Q",
|
||||
"- ",
|
||||
"slds-form-element slds-size--1-of-2",
|
||||
"",
|
||||
"\"",
|
||||
",01236000000i2MO,",
|
||||
";102;",
|
||||
";101;",
|
||||
","
|
||||
],
|
||||
"reverse": false,
|
||||
"show_context": true,
|
||||
"use_buffer2": true,
|
||||
"whole_word": false,
|
||||
"wrap": true
|
||||
},
|
||||
"groups":
|
||||
[
|
||||
{
|
||||
"selected": 1,
|
||||
"sheets":
|
||||
[
|
||||
{
|
||||
"buffer": 0,
|
||||
"file": "package.json",
|
||||
"semi_transient": false,
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 1491,
|
||||
"regions":
|
||||
{
|
||||
},
|
||||
"selection":
|
||||
[
|
||||
[
|
||||
389,
|
||||
389
|
||||
]
|
||||
],
|
||||
"settings":
|
||||
{
|
||||
"auto_complete": true,
|
||||
"git_gutter_is_enabled": true,
|
||||
"syntax": "Packages/MavensMate/sublime/lang/JSON.tmLanguage",
|
||||
"tab_size": 2,
|
||||
"translate_tabs_to_spaces": true
|
||||
},
|
||||
"translation.x": 0.0,
|
||||
"translation.y": 0.0,
|
||||
"zoom_level": 1.0
|
||||
},
|
||||
"stack_index": 2,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"buffer": 1,
|
||||
"semi_transient": false,
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 107,
|
||||
"regions":
|
||||
{
|
||||
},
|
||||
"selection":
|
||||
[
|
||||
[
|
||||
0,
|
||||
107
|
||||
]
|
||||
],
|
||||
"settings":
|
||||
{
|
||||
"auto_name": "# Changelog",
|
||||
"syntax": "Packages/Text/Plain text.tmLanguage"
|
||||
},
|
||||
"translation.x": 0.0,
|
||||
"translation.y": 0.0,
|
||||
"zoom_level": 1.0
|
||||
},
|
||||
"stack_index": 0,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"buffer": 2,
|
||||
"file": "coverage/lcov.info",
|
||||
"semi_transient": false,
|
||||
"settings":
|
||||
{
|
||||
"buffer_size": 4717,
|
||||
"regions":
|
||||
{
|
||||
},
|
||||
"selection":
|
||||
[
|
||||
[
|
||||
916,
|
||||
916
|
||||
]
|
||||
],
|
||||
"settings":
|
||||
{
|
||||
"git_gutter_is_enabled": true,
|
||||
"syntax": "Packages/Text/Plain text.tmLanguage"
|
||||
},
|
||||
"translation.x": 0.0,
|
||||
"translation.y": 602.0,
|
||||
"zoom_level": 1.0
|
||||
},
|
||||
"stack_index": 1,
|
||||
"type": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"incremental_find":
|
||||
{
|
||||
"height": 28.0
|
||||
},
|
||||
"input":
|
||||
{
|
||||
"height": 41.0
|
||||
},
|
||||
"layout":
|
||||
{
|
||||
"cells":
|
||||
[
|
||||
[
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1
|
||||
]
|
||||
],
|
||||
"cols":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"rows":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"menu_visible": true,
|
||||
"output.MavensMate-OutputPanel":
|
||||
{
|
||||
"height": 259.0
|
||||
},
|
||||
"output.find_results":
|
||||
{
|
||||
"height": 0.0
|
||||
},
|
||||
"pinned_build_system": "",
|
||||
"project": "feed.sublime-project",
|
||||
"replace":
|
||||
{
|
||||
"height": 52.0
|
||||
},
|
||||
"save_all_on_build": true,
|
||||
"select_file":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"q.",
|
||||
"src/classes/Q.cls"
|
||||
],
|
||||
[
|
||||
"qord",
|
||||
"src/classes/QOrder.cls"
|
||||
],
|
||||
[
|
||||
"liveagent",
|
||||
"src/pages/LiveAgent_Custom_Chat_Page.page"
|
||||
],
|
||||
[
|
||||
"accounttest",
|
||||
"src/pages/AccountTest.page"
|
||||
],
|
||||
[
|
||||
"attacheddocumentscontrollermvn",
|
||||
"src/classes/AttachedDocumentsControllerMVN.cls"
|
||||
],
|
||||
[
|
||||
"attacheddocumentscontrollertestmvn",
|
||||
"src/classes/AttachedDocumentsControllerTestMVN.cls"
|
||||
]
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"select_project":
|
||||
{
|
||||
"height": 500.0,
|
||||
"last_filter": "apexcov",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"apexcov",
|
||||
"~/Documents/Workspaces/go/src/github.com/jpmonette/apexcov/apexcover.sublime-project"
|
||||
]
|
||||
],
|
||||
"width": 380.0
|
||||
},
|
||||
"select_symbol":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"selected_group": 0,
|
||||
"settings":
|
||||
{
|
||||
},
|
||||
"show_minimap": true,
|
||||
"show_open_files": false,
|
||||
"show_tabs": true,
|
||||
"side_bar_visible": true,
|
||||
"side_bar_width": 305.0,
|
||||
"status_bar_visible": true,
|
||||
"template_settings":
|
||||
{
|
||||
}
|
||||
}
|
||||
507
build/node_modules/feed/lib/feed.js
generated
vendored
Normal file
507
build/node_modules/feed/lib/feed.js
generated
vendored
Normal file
@@ -0,0 +1,507 @@
|
||||
'use strict';
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _xml = require('xml');
|
||||
|
||||
var _xml2 = _interopRequireDefault(_xml);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var GENERATOR = 'Feed for Node.js';
|
||||
var DOCTYPE = '<?xml version="1.0" encoding="utf-8"?>\n';
|
||||
|
||||
var Feed = function () {
|
||||
function Feed(options) {
|
||||
_classCallCheck(this, Feed);
|
||||
|
||||
this.options = options;
|
||||
this.items = [];
|
||||
this.categories = [];
|
||||
this.contributors = [];
|
||||
this.extensions = [];
|
||||
}
|
||||
|
||||
_createClass(Feed, [{
|
||||
key: 'addItem',
|
||||
value: function addItem(item) {
|
||||
this.items.push(item);
|
||||
}
|
||||
}, {
|
||||
key: 'addCategory',
|
||||
value: function addCategory(category) {
|
||||
this.categories.push(category);
|
||||
}
|
||||
}, {
|
||||
key: 'addContributor',
|
||||
value: function addContributor(contributor) {
|
||||
this.contributors.push(contributor);
|
||||
}
|
||||
}, {
|
||||
key: 'addExtension',
|
||||
value: function addExtension(extension) {
|
||||
this.extensions.push(extension);
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render(format) {
|
||||
console.warn('DEPRECATED: use atom1() or rss2() instead of render()');
|
||||
if (format === 'atom-1.0') {
|
||||
return this.atom1();
|
||||
} else {
|
||||
return this.rss2();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'atom1',
|
||||
value: function atom1() {
|
||||
var _this = this;
|
||||
|
||||
var options = this.options;
|
||||
|
||||
|
||||
var feed = [{ _attr: { xmlns: 'http://www.w3.org/2005/Atom' } }, { id: options.id }, { title: options.title }, { updated: options.updated ? this.ISODateString(options.updated) : this.ISODateString(new Date()) }, { generator: options.generator || GENERATOR }];
|
||||
|
||||
var root = [{ feed: feed }];
|
||||
|
||||
if (options.author) {
|
||||
var _options$author = options.author,
|
||||
name = _options$author.name,
|
||||
email = _options$author.email,
|
||||
link = _options$author.link;
|
||||
|
||||
var author = [];
|
||||
|
||||
if (name) {
|
||||
author.push({ name: name });
|
||||
}
|
||||
|
||||
if (email) {
|
||||
author.push({ email: email });
|
||||
}
|
||||
|
||||
if (link) {
|
||||
author.push({ uri: link });
|
||||
}
|
||||
|
||||
feed.push({ author: author });
|
||||
}
|
||||
|
||||
// link (rel="alternate")
|
||||
if (options.link) {
|
||||
feed.push({ link: { _attr: { rel: 'alternate', href: options.link } } });
|
||||
}
|
||||
|
||||
// link (rel="self")
|
||||
var atomLink = options.feed || options.feedLinks && options.feedLinks.atom;
|
||||
if (atomLink) {
|
||||
feed.push({ "link": { _attr: { rel: 'self', href: atomLink } } });
|
||||
}
|
||||
|
||||
// link (rel="hub")
|
||||
if (options.hub) {
|
||||
feed.push({ link: { _attr: { rel: 'hub', href: options.hub } } });
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* "feed" node: optional elements
|
||||
*************************************************************************/
|
||||
|
||||
if (options.description) {
|
||||
feed.push({ subtitle: options.description });
|
||||
}
|
||||
|
||||
if (options.image) {
|
||||
feed.push({ logo: options.image });
|
||||
}
|
||||
|
||||
if (options.favicon) {
|
||||
feed.push({ icon: options.favicon });
|
||||
}
|
||||
|
||||
if (options.copyright) {
|
||||
feed.push({ rights: options.copyright });
|
||||
}
|
||||
|
||||
this.categories.forEach(function (category) {
|
||||
feed.push({ category: [{ _attr: { term: category } }] });
|
||||
});
|
||||
|
||||
this.contributors.forEach(function (item) {
|
||||
var name = item.name,
|
||||
email = item.email,
|
||||
link = item.link;
|
||||
|
||||
var contributor = [];
|
||||
|
||||
if (name) {
|
||||
contributor.push({ name: name });
|
||||
}
|
||||
|
||||
if (email) {
|
||||
contributor.push({ email: email });
|
||||
}
|
||||
|
||||
if (link) {
|
||||
contributor.push({ uri: link });
|
||||
}
|
||||
|
||||
feed.push({ contributor: contributor });
|
||||
});
|
||||
|
||||
// icon
|
||||
|
||||
/**************************************************************************
|
||||
* "entry" nodes
|
||||
*************************************************************************/
|
||||
this.items.forEach(function (item) {
|
||||
//
|
||||
// entry: required elements
|
||||
//
|
||||
|
||||
var entry = [{ title: { _attr: { type: 'html' }, _cdata: item.title } }, { id: item.id || item.link }, { link: [{ _attr: { href: item.link } }] }, { updated: _this.ISODateString(item.date) }];
|
||||
|
||||
//
|
||||
// entry: recommended elements
|
||||
//
|
||||
if (item.description) {
|
||||
entry.push({ summary: { _attr: { type: 'html' }, _cdata: item.description } });
|
||||
}
|
||||
|
||||
if (item.content) {
|
||||
entry.push({ content: { _attr: { type: 'html' }, _cdata: item.content } });
|
||||
}
|
||||
|
||||
// entry author(s)
|
||||
if (Array.isArray(item.author)) {
|
||||
item.author.forEach(function (oneAuthor) {
|
||||
var name = oneAuthor.name,
|
||||
email = oneAuthor.email,
|
||||
link = oneAuthor.link;
|
||||
|
||||
var author = [];
|
||||
|
||||
if (name) {
|
||||
author.push({ name: name });
|
||||
}
|
||||
|
||||
if (email) {
|
||||
author.push({ email: email });
|
||||
}
|
||||
|
||||
if (link) {
|
||||
author.push({ uri: link });
|
||||
}
|
||||
|
||||
entry.push({ author: author });
|
||||
});
|
||||
}
|
||||
|
||||
// content
|
||||
|
||||
// link - relative link to article
|
||||
|
||||
//
|
||||
// entry: optional elements
|
||||
//
|
||||
|
||||
// category
|
||||
|
||||
// contributor
|
||||
if (Array.isArray(item.contributor)) {
|
||||
item.contributor.forEach(function (item) {
|
||||
var name = item.name,
|
||||
email = item.email,
|
||||
link = item.link;
|
||||
|
||||
var contributor = [];
|
||||
|
||||
if (name) {
|
||||
contributor.push({ name: name });
|
||||
}
|
||||
|
||||
if (email) {
|
||||
contributor.push({ email: email });
|
||||
}
|
||||
|
||||
if (link) {
|
||||
contributor.push({ uri: link });
|
||||
}
|
||||
|
||||
entry.push({ contributor: contributor });
|
||||
});
|
||||
}
|
||||
|
||||
// published
|
||||
if (item.published) {
|
||||
entry.push({ published: _this.ISODateString(item.published) });
|
||||
}
|
||||
|
||||
// source
|
||||
|
||||
// rights
|
||||
if (item.copyright) {
|
||||
entry.push({ rights: item.copyright });
|
||||
}
|
||||
|
||||
feed.push({ entry: entry });
|
||||
});
|
||||
|
||||
return DOCTYPE + (0, _xml2.default)(root, true);
|
||||
}
|
||||
}, {
|
||||
key: 'rss2',
|
||||
value: function rss2() {
|
||||
var options = this.options;
|
||||
|
||||
var isAtom = false;
|
||||
var isContent = false;
|
||||
|
||||
var channel = [{ title: options.title }, { link: options.link }, { description: options.description }, { lastBuildDate: options.updated ? options.updated.toUTCString() : new Date().toUTCString() }, { docs: 'http://blogs.law.harvard.edu/tech/rss' }, { generator: options.generator || GENERATOR }];
|
||||
|
||||
var rss = [{ _attr: { version: '2.0' } }, { channel: channel }];
|
||||
|
||||
var root = [{ rss: rss }];
|
||||
|
||||
/**
|
||||
* Channel Image
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#ltimagegtSubelementOfLtchannelgt
|
||||
*/
|
||||
if (options.image) {
|
||||
channel.push({
|
||||
image: [{ title: options.title }, { url: options.image }, { link: options.link }]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Copyright
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#optionalChannelElements
|
||||
*/
|
||||
if (options.copyright) {
|
||||
channel.push({ copyright: options.copyright });
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Categories
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#comments
|
||||
*/
|
||||
this.categories.forEach(function (category) {
|
||||
channel.push({ category: category });
|
||||
});
|
||||
|
||||
/**
|
||||
* Feed URL
|
||||
* http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
|
||||
*/
|
||||
var atomLink = options.feed || options.feedLinks && options.feedLinks.atom;
|
||||
if (atomLink) {
|
||||
isAtom = true;
|
||||
|
||||
channel.push({
|
||||
"atom:link": {
|
||||
_attr: {
|
||||
href: atomLink,
|
||||
rel: 'self',
|
||||
type: 'application/rss+xml'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hub for PubSubHubbub
|
||||
* https://code.google.com/p/pubsubhubbub/
|
||||
*/
|
||||
if (options.hub) {
|
||||
isAtom = true;
|
||||
channel.push({
|
||||
"atom:link": {
|
||||
_attr: {
|
||||
href: options.hub,
|
||||
rel: 'hub'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Categories
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#hrelementsOfLtitemgt
|
||||
*/
|
||||
this.items.forEach(function (entry) {
|
||||
var item = [];
|
||||
|
||||
if (entry.title) {
|
||||
item.push({ title: { _cdata: entry.title } });
|
||||
}
|
||||
|
||||
if (entry.link) {
|
||||
item.push({ link: entry.link });
|
||||
}
|
||||
|
||||
if (entry.guid) {
|
||||
item.push({ guid: entry.guid });
|
||||
} else if (entry.link) {
|
||||
item.push({ guid: entry.link });
|
||||
}
|
||||
|
||||
if (entry.date) {
|
||||
item.push({ pubDate: entry.date.toUTCString() });
|
||||
}
|
||||
|
||||
if (entry.description) {
|
||||
item.push({ description: { _cdata: entry.description } });
|
||||
}
|
||||
|
||||
if (entry.content) {
|
||||
isContent = true;
|
||||
item.push({ 'content:encoded': { _cdata: entry.content } });
|
||||
}
|
||||
/**
|
||||
* Item Author
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt
|
||||
*/
|
||||
if (Array.isArray(entry.author)) {
|
||||
entry.author.some(function (author) {
|
||||
if (author.email && author.name) {
|
||||
item.push({ author: author.email + ' (' + author.name + ')' });
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (entry.image) {
|
||||
item.push({ enclosure: [{ _attr: { url: entry.image } }] });
|
||||
}
|
||||
|
||||
channel.push({ item: item });
|
||||
});
|
||||
|
||||
if (isContent) {
|
||||
rss[0]._attr['xmlns:content'] = 'http://purl.org/rss/1.0/modules/content/';
|
||||
}
|
||||
|
||||
if (isAtom) {
|
||||
rss[0]._attr['xmlns:atom'] = 'http://www.w3.org/2005/Atom';
|
||||
}
|
||||
|
||||
return DOCTYPE + (0, _xml2.default)(root, true);
|
||||
}
|
||||
}, {
|
||||
key: 'json1',
|
||||
value: function json1() {
|
||||
var _this2 = this;
|
||||
|
||||
var options = this.options,
|
||||
items = this.items,
|
||||
extensions = this.extensions;
|
||||
|
||||
var feed = {
|
||||
version: 'https://jsonfeed.org/version/1',
|
||||
title: options.title
|
||||
};
|
||||
|
||||
if (options.link) {
|
||||
feed.home_page_url = options.link;
|
||||
}
|
||||
|
||||
if (options.feedLinks && options.feedLinks.json) {
|
||||
feed.feed_url = options.feedLinks.json;
|
||||
}
|
||||
|
||||
if (options.description) {
|
||||
feed.description = options.description;
|
||||
}
|
||||
|
||||
if (options.image) {
|
||||
feed.icon = options.image;
|
||||
}
|
||||
|
||||
if (options.author) {
|
||||
feed.author = {};
|
||||
if (options.author.name) {
|
||||
feed.author.name = options.author.name;
|
||||
}
|
||||
if (options.author.link) {
|
||||
feed.author.url = options.author.link;
|
||||
}
|
||||
}
|
||||
|
||||
extensions.forEach(function (e) {
|
||||
feed[e.name] = e.objects;
|
||||
});
|
||||
|
||||
feed.items = items.map(function (item) {
|
||||
var feedItem = {
|
||||
id: item.id,
|
||||
// json_feed distinguishes between html and text content
|
||||
// but since we only take a single type, we'll assume HTML
|
||||
html_content: item.content
|
||||
};
|
||||
if (item.link) {
|
||||
feedItem.url = item.link;
|
||||
}
|
||||
if (item.title) {
|
||||
feedItem.title = item.title;
|
||||
}
|
||||
if (item.description) {
|
||||
feedItem.summary = item.description;
|
||||
}
|
||||
|
||||
if (item.image) {
|
||||
feedItem.image = item.image;
|
||||
}
|
||||
|
||||
if (item.date) {
|
||||
feedItem.date_modified = _this2.ISODateString(item.date);
|
||||
}
|
||||
if (item.published) {
|
||||
feedItem.date_published = _this2.ISODateString(item.published);
|
||||
}
|
||||
|
||||
if (item.author) {
|
||||
var author = item.author;
|
||||
if (author instanceof Array) {
|
||||
// json feed only supports 1 author per post
|
||||
author = author[0];
|
||||
}
|
||||
feedItem.author = {};
|
||||
if (author.name) {
|
||||
feedItem.author.name = author.name;
|
||||
}
|
||||
if (author.link) {
|
||||
feedItem.author.url = author.link;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.extensions) {
|
||||
item.extensions.forEach(function (e) {
|
||||
feedItem[e.name] = e.objects;
|
||||
});
|
||||
}
|
||||
|
||||
return feedItem;
|
||||
});
|
||||
|
||||
return JSON.stringify(feed, null, 4);
|
||||
}
|
||||
}, {
|
||||
key: 'ISODateString',
|
||||
value: function ISODateString(d) {
|
||||
function pad(n) {
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + 'Z';
|
||||
}
|
||||
}]);
|
||||
|
||||
return Feed;
|
||||
}();
|
||||
|
||||
module.exports = Feed;
|
||||
//# sourceMappingURL=feed.js.map
|
||||
1
build/node_modules/feed/lib/feed.js.map
generated
vendored
Normal file
1
build/node_modules/feed/lib/feed.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
93
build/node_modules/feed/package.json
generated
vendored
Executable file
93
build/node_modules/feed/package.json
generated
vendored
Executable file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"_from": "feed",
|
||||
"_id": "feed@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-kUiXUX6U+jJ8xvc7tYWkfEqe0yE=",
|
||||
"_location": "/feed",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "feed",
|
||||
"name": "feed",
|
||||
"escapedName": "feed",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/feed/-/feed-1.1.1.tgz",
|
||||
"_shasum": "914897517e94fa327cc6f73bb585a47c4a9ed321",
|
||||
"_spec": "feed",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"author": {
|
||||
"name": "Jean-Philippe Monette",
|
||||
"email": "contact@jpmonette.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jpmonette/feed/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Ben McCormick",
|
||||
"email": "ben.mccormick@windsorcircle.com"
|
||||
},
|
||||
{
|
||||
"name": "Pierre Galvez",
|
||||
"email": "contact@pierre-galvez.fr"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"xml": "^1.0.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Feed is a RSS and Atom feed generator for Node.js, making content syndication simple and intuitive!",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.24.1",
|
||||
"babel-preset-env": "^1.5.1",
|
||||
"codeclimate-test-reporter": "^0.5.0",
|
||||
"coveralls": "^2.13.1",
|
||||
"jest": "^20.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"homepage": "http://projets.jpmonette.net/en/feed",
|
||||
"jest": {
|
||||
"verbose": true,
|
||||
"collectCoverage": true,
|
||||
"collectCoverageFrom": [
|
||||
"**/src/*.{js}"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/*.spec.js"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"rss",
|
||||
"atom",
|
||||
"feed",
|
||||
"syndication",
|
||||
"xml",
|
||||
"wrapper",
|
||||
"blog"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/feed.js",
|
||||
"name": "feed",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jpmonette/feed.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rm -rf lib/ && mkdir lib && babel -d lib/ src/ --ignore **/*.spec.js -s",
|
||||
"prepublish": "npm run build",
|
||||
"test": "export NODE_ENV=test && jest",
|
||||
"test-travis": "export NODE_ENV=test && jest --coverage"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
||||
492
build/node_modules/feed/src/feed.js
generated
vendored
Normal file
492
build/node_modules/feed/src/feed.js
generated
vendored
Normal file
@@ -0,0 +1,492 @@
|
||||
import xml from 'xml'
|
||||
|
||||
const GENERATOR = 'Feed for Node.js'
|
||||
const DOCTYPE = '<?xml version="1.0" encoding="utf-8"?>\n'
|
||||
|
||||
class Feed {
|
||||
|
||||
constructor(options) {
|
||||
this.options = options
|
||||
this.items = []
|
||||
this.categories = []
|
||||
this.contributors = []
|
||||
this.extensions = []
|
||||
}
|
||||
|
||||
addItem(item) {
|
||||
this.items.push(item)
|
||||
}
|
||||
|
||||
addCategory(category) {
|
||||
this.categories.push(category)
|
||||
}
|
||||
|
||||
addContributor(contributor) {
|
||||
this.contributors.push(contributor)
|
||||
}
|
||||
|
||||
addExtension(extension) {
|
||||
this.extensions.push(extension)
|
||||
}
|
||||
|
||||
render(format) {
|
||||
console.warn('DEPRECATED: use atom1() or rss2() instead of render()');
|
||||
if (format === 'atom-1.0') {
|
||||
return this.atom1();
|
||||
} else {
|
||||
return this.rss2();
|
||||
}
|
||||
}
|
||||
|
||||
atom1() {
|
||||
const { options } = this
|
||||
|
||||
let feed = [
|
||||
{ _attr: { xmlns: 'http://www.w3.org/2005/Atom' } },
|
||||
{ id: options.id },
|
||||
{ title: options.title },
|
||||
{ updated: (options.updated ? this.ISODateString(options.updated) : this.ISODateString(new Date())) },
|
||||
{ generator: options.generator || GENERATOR },
|
||||
]
|
||||
|
||||
let root = [{ feed }]
|
||||
|
||||
if (options.author) {
|
||||
const { name, email, link } = options.author
|
||||
let author = []
|
||||
|
||||
if (name) {
|
||||
author.push({ name });
|
||||
}
|
||||
|
||||
if (email) {
|
||||
author.push({ email });
|
||||
}
|
||||
|
||||
if (link) {
|
||||
author.push({ uri: link });
|
||||
}
|
||||
|
||||
feed.push({ author })
|
||||
}
|
||||
|
||||
// link (rel="alternate")
|
||||
if(options.link) {
|
||||
feed.push({ link: { _attr: { rel: 'alternate', href: options.link }}});
|
||||
}
|
||||
|
||||
// link (rel="self")
|
||||
const atomLink = options.feed || (options.feedLinks && options.feedLinks.atom);
|
||||
if(atomLink) {
|
||||
feed.push({ "link": { _attr: { rel: 'self', href: atomLink }}});
|
||||
}
|
||||
|
||||
// link (rel="hub")
|
||||
if(options.hub) {
|
||||
feed.push({ link: { _attr: { rel:'hub', href: options.hub }}});
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* "feed" node: optional elements
|
||||
*************************************************************************/
|
||||
|
||||
if(options.description) {
|
||||
feed.push({ subtitle: options.description });
|
||||
}
|
||||
|
||||
if(options.image) {
|
||||
feed.push({ logo: options.image });
|
||||
}
|
||||
|
||||
if(options.favicon) {
|
||||
feed.push({ icon: options.favicon });
|
||||
}
|
||||
|
||||
if(options.copyright) {
|
||||
feed.push({ rights: options.copyright });
|
||||
}
|
||||
|
||||
this.categories.forEach(category => {
|
||||
feed.push({ category: [{ _attr: { term: category } }] });
|
||||
})
|
||||
|
||||
this.contributors.forEach(item => {
|
||||
const { name, email, link } = item
|
||||
let contributor = [];
|
||||
|
||||
if(name) {
|
||||
contributor.push({ name });
|
||||
}
|
||||
|
||||
if(email) {
|
||||
contributor.push({ email });
|
||||
}
|
||||
|
||||
if(link) {
|
||||
contributor.push({ uri: link });
|
||||
}
|
||||
|
||||
feed.push({ contributor });
|
||||
})
|
||||
|
||||
// icon
|
||||
|
||||
/**************************************************************************
|
||||
* "entry" nodes
|
||||
*************************************************************************/
|
||||
this.items.forEach(item => {
|
||||
//
|
||||
// entry: required elements
|
||||
//
|
||||
|
||||
let entry = [
|
||||
{ title: { _attr: { type: 'html' }, _cdata: item.title }},
|
||||
{ id: item.id || item.link },
|
||||
{ link: [{ _attr: { href: item.link } }]},
|
||||
{ updated: this.ISODateString(item.date) }
|
||||
]
|
||||
|
||||
//
|
||||
// entry: recommended elements
|
||||
//
|
||||
if(item.description) {
|
||||
entry.push({ summary: { _attr: { type: 'html' }, _cdata: item.description }});
|
||||
}
|
||||
|
||||
if(item.content) {
|
||||
entry.push({ content: { _attr: { type: 'html' }, _cdata: item.content }});
|
||||
}
|
||||
|
||||
// entry author(s)
|
||||
if(Array.isArray(item.author)) {
|
||||
item.author.forEach(oneAuthor => {
|
||||
const { name, email, link } = oneAuthor
|
||||
let author = [];
|
||||
|
||||
if(name) {
|
||||
author.push({ name });
|
||||
}
|
||||
|
||||
if(email) {
|
||||
author.push({ email });
|
||||
}
|
||||
|
||||
if(link) {
|
||||
author.push({ uri: link });
|
||||
}
|
||||
|
||||
entry.push({ author });
|
||||
})
|
||||
}
|
||||
|
||||
// content
|
||||
|
||||
// link - relative link to article
|
||||
|
||||
//
|
||||
// entry: optional elements
|
||||
//
|
||||
|
||||
// category
|
||||
|
||||
// contributor
|
||||
if(Array.isArray(item.contributor)) {
|
||||
item.contributor.forEach(item => {
|
||||
const { name, email, link } = item
|
||||
let contributor = [];
|
||||
|
||||
if(name) {
|
||||
contributor.push({ name });
|
||||
}
|
||||
|
||||
if(email) {
|
||||
contributor.push({ email });
|
||||
}
|
||||
|
||||
if(link) {
|
||||
contributor.push({ uri: link });
|
||||
}
|
||||
|
||||
entry.push({ contributor });
|
||||
})
|
||||
}
|
||||
|
||||
// published
|
||||
if(item.published) {
|
||||
entry.push({ published: this.ISODateString(item.published) });
|
||||
}
|
||||
|
||||
// source
|
||||
|
||||
// rights
|
||||
if(item.copyright) {
|
||||
entry.push({ rights: item.copyright });
|
||||
}
|
||||
|
||||
feed.push({ entry: entry });
|
||||
})
|
||||
|
||||
return DOCTYPE + xml(root, true);
|
||||
}
|
||||
|
||||
rss2() {
|
||||
const { options } = this
|
||||
let isAtom = false
|
||||
let isContent = false
|
||||
|
||||
let channel = [
|
||||
{ title: options.title },
|
||||
{ link: options.link },
|
||||
{ description: options.description },
|
||||
{ lastBuildDate: (options.updated ? options.updated.toUTCString() : new Date().toUTCString()) },
|
||||
{ docs: 'http://blogs.law.harvard.edu/tech/rss'},
|
||||
{ generator: options.generator || GENERATOR },
|
||||
]
|
||||
|
||||
let rss = [
|
||||
{ _attr: { version: '2.0' } },
|
||||
{ channel },
|
||||
]
|
||||
|
||||
let root = [{ rss }]
|
||||
|
||||
/**
|
||||
* Channel Image
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#ltimagegtSubelementOfLtchannelgt
|
||||
*/
|
||||
if(options.image) {
|
||||
channel.push({
|
||||
image: [
|
||||
{ title: options.title },
|
||||
{ url: options.image },
|
||||
{ link: options.link },
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Copyright
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#optionalChannelElements
|
||||
*/
|
||||
if(options.copyright) {
|
||||
channel.push({ copyright: options.copyright });
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Categories
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#comments
|
||||
*/
|
||||
this.categories.forEach(category => {
|
||||
channel.push({ category });
|
||||
})
|
||||
|
||||
/**
|
||||
* Feed URL
|
||||
* http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
|
||||
*/
|
||||
const atomLink = options.feed || (options.feedLinks && options.feedLinks.atom);
|
||||
if(atomLink) {
|
||||
isAtom = true
|
||||
|
||||
channel.push({
|
||||
"atom:link": {
|
||||
_attr: {
|
||||
href: atomLink,
|
||||
rel: 'self',
|
||||
type: 'application/rss+xml',
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Hub for PubSubHubbub
|
||||
* https://code.google.com/p/pubsubhubbub/
|
||||
*/
|
||||
if(options.hub) {
|
||||
isAtom = true;
|
||||
channel.push({
|
||||
"atom:link": {
|
||||
_attr: {
|
||||
href: options.hub,
|
||||
rel: 'hub',
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel Categories
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#hrelementsOfLtitemgt
|
||||
*/
|
||||
this.items.forEach(entry => {
|
||||
let item = [];
|
||||
|
||||
if(entry.title) {
|
||||
item.push({ title: { _cdata: entry.title }});
|
||||
}
|
||||
|
||||
if(entry.link) {
|
||||
item.push({ link: entry.link });
|
||||
}
|
||||
|
||||
if(entry.guid) {
|
||||
item.push({ guid: entry.guid });
|
||||
} else if (entry.link) {
|
||||
item.push({ guid: entry.link });
|
||||
}
|
||||
|
||||
if(entry.date) {
|
||||
item.push({ pubDate: entry.date.toUTCString() });
|
||||
}
|
||||
|
||||
if(entry.description) {
|
||||
item.push({ description: { _cdata: entry.description }});
|
||||
}
|
||||
|
||||
if(entry.content) {
|
||||
isContent = true;
|
||||
item.push({ 'content:encoded': { _cdata: entry.content }});
|
||||
}
|
||||
/**
|
||||
* Item Author
|
||||
* http://cyber.law.harvard.edu/rss/rss.html#ltauthorgtSubelementOfLtitemgt
|
||||
*/
|
||||
if(Array.isArray(entry.author)) {
|
||||
entry.author.some(author => {
|
||||
if (author.email && author.name) {
|
||||
item.push({ author: author.email + ' (' + author.name + ')' })
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if(entry.image) {
|
||||
item.push({ enclosure: [{ _attr: { url: entry.image } }] });
|
||||
}
|
||||
|
||||
channel.push({ item });
|
||||
})
|
||||
|
||||
if(isContent) {
|
||||
rss[0]._attr['xmlns:content'] = 'http://purl.org/rss/1.0/modules/content/';
|
||||
}
|
||||
|
||||
if(isAtom) {
|
||||
rss[0]._attr['xmlns:atom'] = 'http://www.w3.org/2005/Atom';
|
||||
}
|
||||
|
||||
return DOCTYPE + xml(root, true);
|
||||
}
|
||||
|
||||
json1() {
|
||||
const { options, items, extensions } = this
|
||||
let feed = {
|
||||
version: 'https://jsonfeed.org/version/1',
|
||||
title: options.title,
|
||||
};
|
||||
|
||||
if (options.link) {
|
||||
feed.home_page_url = options.link;
|
||||
}
|
||||
|
||||
if (options.feedLinks && options.feedLinks.json) {
|
||||
feed.feed_url = options.feedLinks.json;
|
||||
}
|
||||
|
||||
if (options.description) {
|
||||
feed.description = options.description;
|
||||
}
|
||||
|
||||
|
||||
if (options.image) {
|
||||
feed.icon = options.image;
|
||||
}
|
||||
|
||||
if (options.author) {
|
||||
feed.author = {};
|
||||
if (options.author.name) {
|
||||
feed.author.name = options.author.name;
|
||||
}
|
||||
if (options.author.link) {
|
||||
feed.author.url = options.author.link;
|
||||
}
|
||||
}
|
||||
|
||||
extensions.forEach(e => {
|
||||
feed[e.name] = e.objects;
|
||||
});
|
||||
|
||||
feed.items = items.map(item => {
|
||||
let feedItem = {
|
||||
id: item.id,
|
||||
// json_feed distinguishes between html and text content
|
||||
// but since we only take a single type, we'll assume HTML
|
||||
html_content: item.content,
|
||||
}
|
||||
if (item.link) {
|
||||
feedItem.url = item.link;
|
||||
}
|
||||
if(item.title) {
|
||||
feedItem.title = item.title;
|
||||
}
|
||||
if (item.description) {
|
||||
feedItem.summary = item.description;
|
||||
}
|
||||
|
||||
if (item.image) {
|
||||
feedItem.image = item.image
|
||||
}
|
||||
|
||||
if (item.date) {
|
||||
feedItem.date_modified = this.ISODateString(item.date);
|
||||
}
|
||||
if (item.published) {
|
||||
feedItem.date_published = this.ISODateString(item.published);
|
||||
}
|
||||
|
||||
if (item.author) {
|
||||
let author = item.author;
|
||||
if (author instanceof Array) {
|
||||
// json feed only supports 1 author per post
|
||||
author = author[0];
|
||||
}
|
||||
feedItem.author = {};
|
||||
if (author.name) {
|
||||
feedItem.author.name = author.name;
|
||||
}
|
||||
if (author.link) {
|
||||
feedItem.author.url = author.link;
|
||||
}
|
||||
}
|
||||
|
||||
if(item.extensions) {
|
||||
item.extensions.forEach(e => {
|
||||
feedItem[e.name] = e.objects;
|
||||
});
|
||||
}
|
||||
|
||||
return feedItem;
|
||||
});
|
||||
|
||||
return JSON.stringify(feed, null, 4);
|
||||
}
|
||||
|
||||
ISODateString(d) {
|
||||
function pad(n) {
|
||||
return n<10 ? '0'+n : n
|
||||
}
|
||||
|
||||
return d.getUTCFullYear() + '-'
|
||||
+ pad(d.getUTCMonth() + 1) + '-'
|
||||
+ pad(d.getUTCDate()) + 'T'
|
||||
+ pad(d.getUTCHours()) + ':'
|
||||
+ pad(d.getUTCMinutes()) + ':'
|
||||
+ pad(d.getUTCSeconds()) + 'Z'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Feed
|
||||
215
build/node_modules/feed/src/feed.spec.js
generated
vendored
Normal file
215
build/node_modules/feed/src/feed.spec.js
generated
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
import Feed from './feed'
|
||||
|
||||
let sampleDate = new Date('Sat, 13 Jul 2013 23:00:00 GMT');
|
||||
|
||||
let feed = new Feed({
|
||||
title: 'Feed Title',
|
||||
description: 'This is my personnal feed!',
|
||||
link: 'http://example.com/',
|
||||
id: 'http://example.com/',
|
||||
feed: 'http://example.com/feed.rss',
|
||||
image: 'http://example.com/image.png',
|
||||
copyright: 'All rights reserved 2013, John Doe',
|
||||
updated: sampleDate, // optional, default = today
|
||||
generator: 'awesome', // optional, default = 'Feed for Node.js'
|
||||
|
||||
author: {
|
||||
name: 'John Doe',
|
||||
email: 'johndoe@example.com',
|
||||
link: 'https://example.com/johndoe'
|
||||
}
|
||||
})
|
||||
|
||||
feed.addCategory('Technology')
|
||||
|
||||
feed.addContributor({
|
||||
name: 'Johan Cruyff',
|
||||
email: 'johancruyff@example.com',
|
||||
link: 'https://example.com/johancruyff'
|
||||
})
|
||||
|
||||
feed.addItem({
|
||||
title: 'Hello World',
|
||||
id: 'https://example.com/hello-world',
|
||||
link: 'https://example.com/hello-world',
|
||||
description: 'This is an article about Hello World.',
|
||||
author: [{
|
||||
name: 'Jane Doe',
|
||||
email: 'janedoe@example.com',
|
||||
link: 'https://example.com/janedoe'
|
||||
}, {
|
||||
name: 'Joe Smith',
|
||||
email: 'joesmith@example.com',
|
||||
link: 'https://example.com/joesmith'
|
||||
}],
|
||||
contributor: [{
|
||||
name: 'Shawn Kemp',
|
||||
email: 'shawnkemp@example.com',
|
||||
link: 'https://example.com/shawnkemp'
|
||||
}, {
|
||||
name: 'Reggie Miller',
|
||||
email: 'reggiemiller@example.com',
|
||||
link: 'https://example.com/reggiemiller'
|
||||
}],
|
||||
extensions: [{
|
||||
name: '_item_extension_1',
|
||||
objects: {
|
||||
about: 'just an item extension example',
|
||||
dummy1: 'example'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '_item_extension_2',
|
||||
objects: {
|
||||
about: 'just a second item extension example',
|
||||
dummy1: 'example'
|
||||
}
|
||||
}],
|
||||
date: sampleDate,
|
||||
image: 'https://example.com/hello-world.jpg'
|
||||
})
|
||||
|
||||
feed.addExtension({
|
||||
name: '_example_extension',
|
||||
objects: {
|
||||
about: 'just an extension example',
|
||||
dummy: 'example'
|
||||
}
|
||||
});
|
||||
|
||||
test('it should generate an RSS 2.0 feed', () => {
|
||||
let expected = `<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
|
||||
<channel>
|
||||
<title>Feed Title</title>
|
||||
<link>http://example.com/</link>
|
||||
<description>This is my personnal feed!</description>
|
||||
<lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<generator>awesome</generator>
|
||||
<image>
|
||||
<title>Feed Title</title>
|
||||
<url>http://example.com/image.png</url>
|
||||
<link>http://example.com/</link>
|
||||
</image>
|
||||
<copyright>All rights reserved 2013, John Doe</copyright>
|
||||
<category>Technology</category>
|
||||
<atom:link href=\"http://example.com/feed.rss\" rel=\"self\" type=\"application/rss+xml\"/>
|
||||
<item>
|
||||
<title><![CDATA[Hello World]]></title>
|
||||
<link>https://example.com/hello-world</link>
|
||||
<guid>https://example.com/hello-world</guid>
|
||||
<pubDate>Sat, 13 Jul 2013 23:00:00 GMT</pubDate>
|
||||
<description><![CDATA[This is an article about Hello World.]]></description>
|
||||
<author>janedoe@example.com (Jane Doe)</author>
|
||||
<enclosure url="https://example.com/hello-world.jpg">
|
||||
</enclosure>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>`;
|
||||
|
||||
let actual = feed.rss2()
|
||||
|
||||
expect(actual).toBe(expected)
|
||||
});
|
||||
|
||||
test('it should generate an Atom 1.0 feed', () => {
|
||||
let expected = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<id>http://example.com/</id>
|
||||
<title>Feed Title</title>
|
||||
<updated>2013-07-13T23:00:00Z</updated>
|
||||
<generator>awesome</generator>
|
||||
<author>
|
||||
<name>John Doe</name>
|
||||
<email>johndoe@example.com</email>
|
||||
<uri>https://example.com/johndoe</uri>
|
||||
</author>
|
||||
<link rel="alternate" href="http://example.com/"/>
|
||||
<link rel="self" href="http://example.com/feed.rss"/>
|
||||
<subtitle>This is my personnal feed!</subtitle>
|
||||
<logo>http://example.com/image.png</logo>
|
||||
<rights>All rights reserved 2013, John Doe</rights>
|
||||
<category term="Technology">
|
||||
</category>
|
||||
<contributor>
|
||||
<name>Johan Cruyff</name>
|
||||
<email>johancruyff@example.com</email>
|
||||
<uri>https://example.com/johancruyff</uri>
|
||||
</contributor>
|
||||
<entry>
|
||||
<title type="html"><![CDATA[Hello World]]></title>
|
||||
<id>https://example.com/hello-world</id>
|
||||
<link href="https://example.com/hello-world">
|
||||
</link>
|
||||
<updated>2013-07-13T23:00:00Z</updated>
|
||||
<summary type="html"><![CDATA[This is an article about Hello World.]]></summary>
|
||||
<author>
|
||||
<name>Jane Doe</name>
|
||||
<email>janedoe@example.com</email>
|
||||
<uri>https://example.com/janedoe</uri>
|
||||
</author>
|
||||
<author>
|
||||
<name>Joe Smith</name>
|
||||
<email>joesmith@example.com</email>
|
||||
<uri>https://example.com/joesmith</uri>
|
||||
</author>
|
||||
<contributor>
|
||||
<name>Shawn Kemp</name>
|
||||
<email>shawnkemp@example.com</email>
|
||||
<uri>https://example.com/shawnkemp</uri>
|
||||
</contributor>
|
||||
<contributor>
|
||||
<name>Reggie Miller</name>
|
||||
<email>reggiemiller@example.com</email>
|
||||
<uri>https://example.com/reggiemiller</uri>
|
||||
</contributor>
|
||||
</entry>
|
||||
</feed>`;
|
||||
|
||||
let actual = feed.atom1()
|
||||
|
||||
expect(actual).toBe(expected)
|
||||
});
|
||||
|
||||
test('it should generate a JSON v1 Feed', () => {
|
||||
let expected = {
|
||||
"author": {
|
||||
"name": "John Doe",
|
||||
"url": "https://example.com/johndoe"
|
||||
},
|
||||
"description": "This is my personnal feed!",
|
||||
"home_page_url": "http://example.com/",
|
||||
"icon": "http://example.com/image.png",
|
||||
"items": [{
|
||||
"author": {
|
||||
"name": "Jane Doe",
|
||||
"url": "https://example.com/janedoe"
|
||||
},
|
||||
"date_modified": "2013-07-13T23:00:00Z",
|
||||
"id": "https://example.com/hello-world",
|
||||
"image": "https://example.com/hello-world.jpg",
|
||||
"summary": "This is an article about Hello World.",
|
||||
"title": "Hello World",
|
||||
"url": "https://example.com/hello-world",
|
||||
"_item_extension_1": {
|
||||
"about": "just an item extension example",
|
||||
"dummy1": "example"
|
||||
},
|
||||
"_item_extension_2": {
|
||||
"about": "just a second item extension example",
|
||||
"dummy1": "example"
|
||||
}
|
||||
}],
|
||||
"_example_extension": {
|
||||
"about": "just an extension example",
|
||||
"dummy": "example"
|
||||
},
|
||||
"title": "Feed Title",
|
||||
"version": "https://jsonfeed.org/version/1"
|
||||
};
|
||||
|
||||
let actual = JSON.parse(feed.json1());
|
||||
|
||||
expect(actual).toEqual(expected)
|
||||
});
|
||||
49
build/node_modules/feed/test/feed.js
generated
vendored
Normal file
49
build/node_modules/feed/test/feed.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
var assert = require("assert"),
|
||||
Feed = require('../lib/feed.js')
|
||||
|
||||
describe('RSS 2.0', function () {
|
||||
|
||||
it('should return a standard feed', function () {
|
||||
|
||||
var feed = new Feed({
|
||||
title: 'Feed Title',
|
||||
description: 'This is my personnal feed!',
|
||||
link: 'http://example.com/',
|
||||
image: 'http://example.com/image.png',
|
||||
copyright: 'All rights reserved 2013, John Doe',
|
||||
updated: new Date('Sat, 13 Jul 2013 23:00:00 GMT'), // optional, default = today
|
||||
generator: 'awesome', // optional, default = 'Feed for Node.js'
|
||||
|
||||
author: {
|
||||
name: 'John Doe',
|
||||
email: 'johndoe@example.com',
|
||||
link: 'https://example.com/johndoe'
|
||||
}
|
||||
});
|
||||
|
||||
var output = '';
|
||||
|
||||
output += '<?xml version="1.0" encoding="utf-8"?>\n';
|
||||
output += '<rss version="2.0">\n';
|
||||
output += ' <channel>\n';
|
||||
output += ' <title>Feed Title</title>\n';
|
||||
output += ' <description>This is my personnal feed!</description>\n';
|
||||
output += ' <link>http://example.com/</link>\n';
|
||||
output += ' <lastBuildDate>Sat, 13 Jul 2013 23:00:00 GMT</lastBuildDate>\n';
|
||||
output += ' <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n';
|
||||
output += ' <image>\n';
|
||||
output += ' <title>Feed Title</title>\n';
|
||||
output += ' <url>http://example.com/image.png</url>\n';
|
||||
output += ' <link>http://example.com/</link>\n';
|
||||
output += ' </image>\n';
|
||||
output += ' <copyright>All rights reserved 2013, John Doe</copyright>\n';
|
||||
output += ' <generator>awesome</generator>\n';
|
||||
output += ' </channel>\n';
|
||||
output += '</rss>';
|
||||
|
||||
var data = feed.render('rss-2.0');
|
||||
|
||||
assert.equal(data, output);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user