-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect discourse forum #2
Conversation
…breaking compatibility.
index.js
Outdated
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undesirable removal of whitespace
19345b0
to
b52a418
Compare
Add discourse link. Requires andrewda/chattie#2
Add discourse link. Requires andrewda/chattie#2
Add discourse link. Requires andrewda/chattie#2
index.js
Outdated
const parse = require('url').parse; | ||
const rp = require('request-promise'); | ||
const CHAT = require('./resources/chat-types'); | ||
const cherio = require('cherio'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep this like it was, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, no re-indentation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs cheerio
here.
index.js
Outdated
@@ -88,6 +92,10 @@ async function fetchChatLink(url) { | |||
return { type: CHAT['IRC'], url: response.request.href }; | |||
} | |||
|
|||
if(patterns.discourse.exec(generator)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow the formatting of previous RegEx matches. Should be something like this:
const discourseMatches = patterns.discourse.exec(generator)
if (discourseMatches) {
//...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please move this above the IRC matching above as it's more similar to the RegEx ones.
package.json
Outdated
@@ -7,6 +7,7 @@ | |||
"author": "Andrew Dassonville <dassonville.andrew@gmail.com>", | |||
"license": "MIT", | |||
"dependencies": { | |||
"cherio": "^1.0.0-rc.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luckily the person maintaining cherio
is aliasing it to the correct dependency, cheerio
, but we should be using the official name of this dependency: https://www.npmjs.com/package/cheerio
ping @bekicot |
@jayvdb Do I need to take over this PR? |
@wisn Yes pls. |
Thanks @andrewda |
This patch detect discourse forum