Class StandardSiteEmbeddedCardGenerator
- Namespace
- idunno.Bluesky.Embed
- Assembly
- idunno.Bluesky.dll
Generates an Embedded Card using Standard.Site and OpenGraph metadata from the target URI.
public sealed class StandardSiteEmbeddedCardGenerator : OpenGraphEmbeddedCardGenerator, IEmbeddedCardGenerator, IDisposableInheritance
Implements
Inherited Members
Constructors
StandardSiteEmbeddedCardGenerator(BlueskyAgent)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerILogger-
The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerILogger-
The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerFactoryILoggerFactory?-
The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)
Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.
public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)Parameters
agentBlueskyAgent-
The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.
httpClientHttpClient-
The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.
loggerILogger-
The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.
Exceptions
- ArgumentNullException
-
Thrown if
agentis null.
Methods
Generate(Uri, CancellationToken)
Gets an idunno.Bluesky.Embed.EmbeddedExternal for uri, preferring Standard.Site metadata if available.
public override Task<EmbeddedExternal?> Generate(Uri uri, CancellationToken cancellationToken = default)Parameters
uriUri-
The URI to retrieve Standard.Site data from.
cancellationTokenCancellationToken-
A token to cancel the operation.
Returns
- Task<EmbeddedExternal?>
-
An idunno.Bluesky.Embed.EmbeddedExternal if the page can be fetched and contains correct metadata. If only OpenGraph metadata is available an OpenGraph embed will be returned; otherwise, null.
Exceptions
- ArgumentNullException
-
Thrown if
uriis null - ArgumentException
-
Thrown if
uriis not an absolute URI.
Generate(Uri, CancellationToken)
Gets an idunno.Bluesky.Embed.EmbeddedExternal for uri, preferring Standard.Site metadata if available.
public override Task<EmbeddedExternal?> Generate(Uri uri, CancellationToken cancellationToken = default)Parameters
uriUri-
The URI to retrieve Standard.Site data from.
cancellationTokenCancellationToken-
A token to cancel the operation.
Returns
- Task<EmbeddedExternal?>
-
An idunno.Bluesky.Embed.EmbeddedExternal if the page can be fetched and contains correct metadata. If only OpenGraph metadata is available an OpenGraph embed will be returned; otherwise, null.
Exceptions
- ArgumentNullException
-
Thrown if
uriis null - ArgumentException
-
Thrown if
uriis not an absolute URI.
Generate(Uri, CancellationToken)
Gets an idunno.Bluesky.Embed.EmbeddedExternal for uri, preferring Standard.Site metadata if available.
public override Task<EmbeddedExternal?> Generate(Uri uri, CancellationToken cancellationToken = default)Parameters
uriUri-
The URI to retrieve Standard.Site data from.
cancellationTokenCancellationToken-
A token to cancel the operation.
Returns
- Task<EmbeddedExternal?>
-
An idunno.Bluesky.Embed.EmbeddedExternal if the page can be fetched and contains correct metadata. If only OpenGraph metadata is available an OpenGraph embed will be returned; otherwise, null.
Exceptions
- ArgumentNullException
-
Thrown if
uriis null - ArgumentException
-
Thrown if
uriis not an absolute URI.