Learn how to administer Sophora's Social Media Search & Quote module.
The module Social Media Quote is based on scripts.
The scripts will be triggered when URLs are dropped on the copytext in the editor view of the DeskClient. Additionally, the scripts may be triggered directly for an document via the toolbar of the DeskClient.
The scripts will then scan the copytext for paragraphs containing (exclusively) links of the supported social networks. The links will be resolved and a selection of content will be imported from the respective social network. The original content of the paragraph (i.e. the URL) will be replaced with this content.
Importing the scripts and configuring the repository
- Download the script files from our software repository.
- Import the files under
repo-configuration
, e.g. by using the DeskClient via "Document -> Import". This will add required node types including their configuration to the repository. The "Social-Media-Suche Konfiguration" system configuration document will be created. It contains a table of all the properties which are available to configure the behaviour of the scripts. If the document already exists, the keys for the properties will be added to the end of the table in the document. - In the Administration view of the DeskClient, open the node type configuration of your node type for stories or articles (by default
sophora-content-nt:story
). On the "Form Tabs"-Tab, double-click on the property for the copytext (by default sophora-content:copytext
). The newly imported paragraph types need to be configured as allowed here. - In the Administration view of the DeskClient, open the node type configuration of
sophora-extension-nt:paragraph
. On the "Components"-Tab, double-click on "Paragraph Box" and add sophora-social-media-nt:imageBox
as well as sophora-social-media-nt:authorImageBox
to the list of "ValidChildNodeTypes". Also make sure that the child node sophora-extension:paragraphProperties
is configured on this tab and has the mixin sophora-extension-mix:paragraphProperties
in the list of "ValidChildNodeTypes". Save the configuration. - Import the files under script-documents. This will add the following scripts to the Administration view of the DeskClient: "Import Social Media Posts" (currently only used for the import of GIPHY, Spotify, TikTok, Mastodon, Vimeo, Facebook, YouTube, Instagram and Twitter posts) and "Resolve ScribbleLive URLs".
- For each of these scripts, open the document in the Administration view. Activate the node types on which the script should operate and finally publish the document.
- Configure the scripts via the "Social-Media-Suche Konfiguration" system document (which was added in the first step). The valid values for each property are listed in the source code of the respective script document.
Configuration
Installing the add-on and restarting the DeskClient creates a new configuration document Social Media Search Configuration
in Administration/System/Configuration
, in which the access tokens and import information for the social media platforms have to be entered.
Access tokens (Search)
The access tokens are unique to every user or app (see OAuth). To acquire an access token, an app has to be registered. All platforms offer guides on how to register new apps. These guides are linked below. Example tokens shown here do not work. Tokens work like passwords, so be careful with them. If no access token has been provided, the corresponding social media platform won't be available in the search view.
Please note that the social media platforms limit the amount of search requests that can be performed within a certain time window. For more information about rate limiting refer to the platform's documentation.
Key | Description | Example |
---|
Facebook | See https://developers.facebook.com/docs/facebook-login/access-tokens | |
facebook.access.token | Access token for Facebook | Gn36foSxiUa9htcubwDRNXwRk4YVo0pl |
facebook.app.secret | The application secret | XCuTplscGIJhLH36F2AMsOSbVmFEuDFY |
Import keys (Quote)
The import keys may be added to the Social Media Search Configuration document in order to configure the scripts that create copytext paragraphs to quote posts.
Please note: When importing social media posts, only limited information may be available in the paragraph properties, as changes to the oEmbed API of the respective platform can take effect at any time without further notice. These changes may also affect the placeholders used in the *.import.images.propertiesToSet
and *.import.authorimages.propertiesToSet
configuration keys. If the required data for a placeholder is not available, the placeholder will be replaced by an empty string.
Facebook
Key | Description | Example |
---|
facebook.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
facebook.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
facebook.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
facebook.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
facebook.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
facebook.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
facebook.import.images.idstem | Id stem for created image documents. Default is "facebook-import-image" | facebook-import-image |
facebook.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "facebook-import-image-" | facebook-import-image- |
facebook.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR$, $AUTHOR_URL$, $DATE$, $POST_URL$, $TITLE$ | sophora-extension:caption=$TITLE$ |
facebook.import.authorimages.idstem | Id stem for created author image documents. Default is "facebook-import-author-image" | facebook-import-author-image |
facebook.import.authorimages.externalIdPrefix | Prefix for the external ID of created author image documents. Default is "facebook-import-author-image-" | facebook-import-author-image- |
facebook.import.authorimages.propertiesToSet | Same as for "facebook.import.images.propertiesToSet" but used for the creation of author images. | sophora-extension:alttext=Autor: $AUTHOR$ |
facebook.import.useOEmbedAPI | If set to "true", the post will be imported via the oEmbed API. Please note: When this option is enabled, not all information can be imported. Specifically the publication date as well as all images of the post (author images included) can't be accessed via this manner. Therefore the facebook.import.images.active setting will have no effect, if the oEmbed API should be used. Default is "false". | true |
facebook.import.oEmbedAccessToken | The access token used for accessing oEmbed data (required). This requires a registered Facebook app which has access to the oEmbed endpoint. For more information see https://developers.facebook.com/docs/plugins/oembed | 842165551622222|PK95cVe5gOCPRI922VlxKtDZifV |
GIPHY
Key | Description | Example |
---|
socialmedia.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
giphy.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
giphy.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
giphy.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
giphy.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
giphy.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
giphy.import.images.idstem | Id stem for created image documents. Default is "giphy-import-image" | giphy-import-image |
giphy.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "giphy-import-image-" | giphy-import-image- |
giphy.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR_NAME$, $AUTHOR_URL$, $DATE$, $TITLE$, $POST_URL$ | sophora-extension:caption=$TITLE$ |
Instagram
Key | Description | Example |
---|
instagram.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
instagram.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
instagram.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
instagram.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
instagram.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
instagram.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
instagram.import.images.idstem | Id stem for created image documents. Default is "instagram-import-image" | instagram-import-image |
instagram.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "instagram-import-image-" | instagram-import-image- |
instagram.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR$, $INSTAGRAM_URL$ | sophora-extension:alttext=Autor: $AUTHOR$ |
instagram.import.authorimages.idstem | Id stem for created author image documents. Default is "instagram-import-author-image" | instagram-import-author-image |
instagram.import.authorimages.externalIdPrefix | Prefix for the external ID of created author image documents. Default is "instagram-import-author-image-" | instagram-import-author-image- |
instagram.import.authorimages.propertiesToSet | Same as for "instagram.import.images.propertiesToSet" but used for the creation of author images. | sophora-extension:alttext=Autor: $AUTHOR$ |
instagram.import.oEmbedAccessToken | The access token used for accessing oEmbed data (required). This requires a registered Facebook app which has access to the oEmbed endpoint. For more information see https://developers.facebook.com/docs/instagram/oembed | 842165551622222|PK95cVe5gOCPRI922VlxKtDZifV |
Mastodon
Note that we only support Mastodon URLs containing @user, not @user@server.
Key | Description | Example |
---|
socialmedia.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
ScribbleLive
Key | Description |
---|
scribbleLive.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). |
scribbleLive.default.title | Default title for the ScribbleLive event that will be used as paragraph property. |
scribbleLive.default.themeId | Default theme-id for the ScribbleLive event that will be used as paragraph property. |
scribbleLive.default.height | Default height for the ScribbleLive event that will be used as paragraph property. |
Spotify
Key | Description | Example |
---|
socialmedia.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
spotify.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
spotify.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
spotify.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
spotify.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
spotify.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
spotify.import.images.idstem | Id stem for created image documents. Default is "spotify-import-image" | spotify-import-image |
spotify.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "spotify-import-image-" | spotify-import-image- |
spotify.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR_NAME$, $AUTHOR_URL$, $DATE$, $TITLE$, $POST_URL$ | sophora-extension:caption=$TITLE$ |
TikTok
Key | Description | Example |
---|
socialmedia.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
tiktok.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
tiktok.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
tiktok.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
tiktok.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
tiktok.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
tiktok.import.images.idstem | Id stem for created image documents. Default is "tiktok-import-image" | tiktok-import-image |
tiktok.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "tiktok-import-image-" | tiktok-import-image- |
tiktok.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR_NAME$, $AUTHOR_URL$, $DATE$, $TITLE$, $POST_URL$ | sophora-extension:caption=$TITLE$ |
Vimeo
Key | Description | Example |
---|
socialmedia.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
vimeo.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
vimeo.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
vimeo.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
vimeo.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
vimeo.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
vimeo.import.images.idstem | Id stem for created image documents. Default is "vimeo-import-image" | vimeo-import-image |
vimeo.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "vimeo-import-image-" | vimeo-import-image- |
vimeo.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR_NAME$, $AUTHOR_URL$, $DATE$, $TITLE$, $POST_URL$ | sophora-extension:caption=$TITLE$ |
YouTube
Key | Description | Example |
---|
youtube.import.copytextChildnodeNames | Name of the copytext child nodes that should be scanned by the script (required). | sophora-content:copytext |
youtube.import.images.active | If set to "true", images will be imported and the following configuration parameters become relevant. Default is "false". | true |
youtube.import.images.nodetype | Image node type that will be used when creating images. | sophora-extension-nt:image |
youtube.import.images.refNodetype | Image reference node type that will be used when linking the paragraph to the images. | sophora-content-nt:imageref |
youtube.import.structureNodeExternalId | External ID of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | c4bb5ef9-b3e1-4e1c-9d7b-2f8fe61e60e7 |
youtube.import.structurePath | Path of the structure node where created images should be located. If both external ID and structure path are given, the external ID will be used. If none are given, the image will be located at the same structure node as its embedding document. | /demosite/imports |
youtube.import.images.idstem | Id stem for created image documents. Default is "youtube-import-image" | youtube-import-image |
youtube.import.images.externalIdPrefix | Prefix for the external ID of created image documents. Default is "youtube-import-image-" | youtube-import-image- |
youtube.import.images.propertiesToSet | Expressions to fill properties on the created image documents. Available placeholders: $AUTHOR$, $AUTHOR_URL$, $TITLE$, $YOUTUBE_URL$ | sophora-extension:caption=$TITLE$ |
Configuring Drag And Drop Actions
Dragging a social media post from the Social Media Search into the copytext of a story document will create a new paragraph that contains the URL of the dragged post and execute all scripts with the trigger URL dropped into copytext
(See Scripting). Since the content is not saved in HTML form, it can be structured the way the scripter sees fit for any kind of delivery.