Table of Contents

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, IDisposable

Inheritance

Implements

Inherited Members

Constructors

StandardSiteEmbeddedCardGenerator(BlueskyAgent)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

logger ILogger

The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

logger ILogger

The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILoggerFactory?)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILoggerFactory? loggerFactory)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

loggerFactory ILoggerFactory?

The Microsoft.Extensions.Logging.ILoggerFactory to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is null.

StandardSiteEmbeddedCardGenerator(BlueskyAgent, HttpClient, ILogger)

Creates a new instance of idunno.Bluesky.Embed.StandardSiteEmbeddedCardGenerator.

public StandardSiteEmbeddedCardGenerator(BlueskyAgent agent, HttpClient httpClient, ILogger logger)

Parameters

agent BlueskyAgent

The idunno.Bluesky.BlueskyAgent to use for thumbnail uploading.

httpClient HttpClient

The System.Net.Http.HttpClient to use for making HTTP requests to retrieve Standard.Site data. Ensure the client is hardened against SSRF attacks.

logger ILogger

The Microsoft.Extensions.Logging.ILogger to use for logging. If null, a no-op logger will be used.

Exceptions

ArgumentNullException

Thrown if agent is 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

uri Uri

The URI to retrieve Standard.Site data from.

cancellationToken CancellationToken

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 uri is null

ArgumentException

Thrown if uri is 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

uri Uri

The URI to retrieve Standard.Site data from.

cancellationToken CancellationToken

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 uri is null

ArgumentException

Thrown if uri is 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

uri Uri

The URI to retrieve Standard.Site data from.

cancellationToken CancellationToken

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 uri is null

ArgumentException

Thrown if uri is not an absolute URI.