Difference between revisions of "Extensions:Embed Service"

From Lorekeeper Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
(Added instructions)
Tag: 2017 source edit
 
Line 1: Line 1:
{{Extensioninfobox|title=the extension's name|desc=A short description|auth=Author(s)|status=status (such as WIP, testing, stable)|github={{Github|user=username|branch=branch}}|migration=yes/no|package=yes/no}}
+
{{Extensioninfobox|title=Embed Service|desc=Uses packages to enable data retrieval using URLs|auth=Draginraptor|status=Stable|github={{Github|user=Draginraptor|branch=embed_service}}|migration=no|package=yes}}
<!-- Put a short summary of your extension here! -->
+
This adds the EmbedController and EmbedService, which makes use of the [https://github.com/oscarotero/Embed oscarotero/Embed] library. Requires some familiarity with programming as the additions made had DeviantArt oEmbed in mind and will likely need customisation to suit your needs.
 +
Adds a simple setup for querying URLs in order to retrieve data, such as oEmbed data from DeviantArt, where you can get the image source url. Does not change the site at all.
 +
 
 
== Installation ==
 
== Installation ==
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
+
You will need to install the [https://github.com/oscarotero/Embed oscarotero/Embed] library and have at least one of these [https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations PSR-7 libraries]. The composer.json has already been updated to include these libraries, so if you're not worried about customisation, just run <code>composer update</code> after pulling the branch.
 
== Configuration ==
 
== Configuration ==
<!-- Is any configuration necessary? Describe it here! -->
+
The extension is pretty bare bones so you may want to edit some of the code yourself before using it.
 +
 
 +
The EmbedController currently filters out URLs that aren't related to DeviantArt. This is done using a list of regex patterns, so if you want to allow other URLs you'll just have to add the regex to the list. Alternatively, if you don't want to filter any links out, remove the regex checks.
 +
 
 +
The EmbedService getEmbed function currently returns the oEmbed result specifically. However, not all URLs have an oEmbed result, so you may want to generalise. All relevant documentation can be found at the [https://github.com/oscarotero/Embed oscarotero/Embed] library.
 
== Usage ==
 
== Usage ==
<!-- Is there anything users should know about using your extension? -->
+
This does not affect the site at all and is intended as a quickstart for using the [https://github.com/oscarotero/Embed oscarotero/Embed] library, where a Service and Controller has been set up, along with a relevant route.
 
== Troubleshooting ==
 
== Troubleshooting ==
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
+
You can always find Draginraptor via the Lorekeeper Discord server for help. Feel free to report bugs as well.
 +
I can try to help you customise the extension to your needs, but I can't make promises.
 
== See Also ==
 
== See Also ==
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
+
* [https://github.com/oscarotero/Embed oscarotero/Embed]
 
 

Latest revision as of 08:55, 27 June 2020

Embed Service
Description Uses packages to enable data retrieval using URLs
Author(s) Draginraptor
Status Stable
Github embed_service
LK Version Unspecified
Uses a Package


This adds the EmbedController and EmbedService, which makes use of the oscarotero/Embed library. Requires some familiarity with programming as the additions made had DeviantArt oEmbed in mind and will likely need customisation to suit your needs. Adds a simple setup for querying URLs in order to retrieve data, such as oEmbed data from DeviantArt, where you can get the image source url. Does not change the site at all.

Installation

You will need to install the oscarotero/Embed library and have at least one of these PSR-7 libraries. The composer.json has already been updated to include these libraries, so if you're not worried about customisation, just run composer update after pulling the branch.

Configuration

The extension is pretty bare bones so you may want to edit some of the code yourself before using it.

The EmbedController currently filters out URLs that aren't related to DeviantArt. This is done using a list of regex patterns, so if you want to allow other URLs you'll just have to add the regex to the list. Alternatively, if you don't want to filter any links out, remove the regex checks.

The EmbedService getEmbed function currently returns the oEmbed result specifically. However, not all URLs have an oEmbed result, so you may want to generalise. All relevant documentation can be found at the oscarotero/Embed library.

Usage

This does not affect the site at all and is intended as a quickstart for using the oscarotero/Embed library, where a Service and Controller has been set up, along with a relevant route.

Troubleshooting

You can always find Draginraptor via the Lorekeeper Discord server for help. Feel free to report bugs as well. I can try to help you customise the extension to your needs, but I can't make promises.

See Also