-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67e28c5
commit 46cc5bb
Showing
11 changed files
with
249 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Mentions United script | ||
*/ | ||
const mentionsUnited = { | ||
plugins: {}, | ||
|
||
register(plugin, args) { | ||
const { name } = plugin; | ||
plugin.options = args; | ||
this.plugins[name] = plugin; | ||
}, | ||
|
||
load() { | ||
for (const p in this.plugins) { | ||
this.plugins[p].retrieve(); | ||
} | ||
} | ||
|
||
} | ||
const mentionsUnitedReaction = class { | ||
constructor() { | ||
this.author = new mentionsUnitedAuthor(); | ||
} | ||
author; | ||
received; | ||
type; | ||
source; | ||
sender; | ||
protocol; | ||
url; | ||
content; | ||
toObject() { | ||
const {...object} = this; | ||
object.author = this.author.toObject(); | ||
return object; | ||
} | ||
} | ||
const mentionsUnitedAuthor = class { | ||
name; | ||
avatar; | ||
profile; | ||
toObject() { | ||
const {...object} = this; | ||
return object; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
/** | ||
* Mentions United plugin for retreiving reactions from DevTo | ||
* | ||
* Options: | ||
* - targetUrl = URL of the page mentioned | ||
* - sourceUrl = URL of dev.to article | ||
* - sourceId = ID of dev.to article (only available over API) | ||
* | ||
* Remarks: | ||
* - If 'sourceId' is not provided, the article will fetched over the published articles list | ||
*/ | ||
const mentionsUnited_devto = { | ||
name: "dev.to", | ||
options: { | ||
targetUrl: "", | ||
sourceUrl: "", | ||
sourceId: 0 | ||
}, | ||
retrieve: function () { | ||
console.log(`Retreiving devto reactions on ${this.options.url}`); | ||
console.log(this.options); | ||
|
||
let reactions = []; | ||
|
||
// load reactions from dev.to into 'reactions' | ||
|
||
// let r = new mentionsUnitedReaction(); | ||
// r.author.name = "Me"; | ||
// r.author.avatar = "http//xxx.com"; | ||
// r.author.profile = "https://yyy.com" | ||
// r.type = "comment"; | ||
// console.log(r); | ||
// let ro = r.toObject(); | ||
// console.log(ro); | ||
|
||
reactions.push(r); | ||
//console.log(reactions); | ||
|
||
return reactions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/** | ||
* Mentions United plugin for retreiving reactions from Pixelfed | ||
*/ | ||
const mentionsUnited_pixelfed = { | ||
name: "pixelfed.social", | ||
options: { | ||
//define options and init with null | ||
}, | ||
retrieve: function () { | ||
console.log(`Retreiving pixelfed reactions`); | ||
|
||
let reactions = []; | ||
|
||
// load reactions from dev.to into 'reactions' | ||
|
||
return reactions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
/** | ||
* Mentions United plugin for retreiving webmentions from webmention.io | ||
* | ||
* Options: | ||
* - targetUrl = URL of the page mentioned | ||
* - aliasUrl = alternative URL of the page | ||
* - authorName = Author's name to determine if a wm is a reply of the owner | ||
*/ | ||
const mentionsUnited_webmentions = { | ||
name: "webmention.io", | ||
options: { | ||
targetUrl: "", | ||
aliasUrl: "", | ||
authorName: "" | ||
}, | ||
retrieve: function () { | ||
console.info(`Retreiving webmentions for '${this.options.host}'`); | ||
console.log(this.options); | ||
|
||
let reactions = []; | ||
|
||
// load webmentions from webmention.io into 'reactions' | ||
|
||
return reactions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters