Mika Scraper / PoemGenerator
Function: PoemGenerator()
PoemGenerator(
options
):Promise
<PoemResponse
>
Defined in: src/poem/poem-generator.ts:79
Generates a structured, themed poem using the AIPoemGenerator API (https://aipoemgenerator.ioโ). This function simulates a browser session to:
- Fetch the CSRF token and session cookie from the homepage.
- Submit a POST request with the specified poem parameters.
Parameters
options
Type: GeneratePoemOptions
Default: {}
Configuration options to customize the generated poem, including:
topic
: The subject of the poem.length
: The desired length of the poem.type
: The format or style of the poem (e.g., Haiku, Sonnet).lang
: The language in which the poem should be generated.
Returns
Type: Promise
<PoemResponse
>
A Promise
that resolves to a PoemResponse
object, which contains either the generated poem text or an error message.
Example
const poem = await PoemGenerator({
topic: "starfall",
type: "Haiku",
lang: "English",
length: "short"
});
Last updated on