# Normal JavaScript mode ```{note} For more examples see the [Modules Repo](https://github.com/50n50/sources) ``` In the normal Javascript mode Sora will scrape the HTML of a link and provide it to the function. You are then required to scrape the necessary detail from the HTML and rewrite it into the follow specified JSON format. ## Functions ### searchResults Input: `HTML` \ Output:`JSON` Extracts the search results from the provided HTML. ```json { "title": "Example Title", "image": "https://example.com/image.jpg", "href": "https://grani.me/example" } ``` ### extractDetails Input: `HTML` \ Output:`JSON` Extracts the details from the provided HTML. ```json { "description": "An exciting anime series about adventures.", "aliases": "Alternate Name", "airdate": "2022" } ``` ### extractEpisodes Input: `HTML` \ Output:`JSON` Extracts the episodes from the provided HTML. ```json { "href": "https://grani.me/episode/123", "number": "1" } ``` ### extractStreamUrl Input: `HTML` \ Output:`URL` Extracts the stream from the provided HTML. ```txt https://example.com/stream/video.mp4 ``` ## Example ```javascript function cleanTitle(title) { //Module specefic function, ignore return title .replace(/’/g, "'") .replace(/–/g, "-") .replace(/&#[0-9]+;/g, ""); } function searchResults(html) { const results = []; const baseUrl = "https://grani.me/"; const filmListRegex = /
\s*<\/div>\s*<\/div>/g; const items = html.match(filmListRegex) || []; items.forEach((itemHtml, index) => { const titleMatch = itemHtml.match(/([^<]+)<\/a>/); const href = titleMatch ? titleMatch[1] : ''; let title = titleMatch ? titleMatch[2] : ''; title = cleanTitle(title); const imgMatch = itemHtml.match(/]*class="coveri"[^>]*src="([^"]+)"[^>]*>/); const imageUrl = imgMatch ? imgMatch[1] : ''; if (title && href) { results.push({ title: title.trim(), image: imageUrl.trim(), href: href.trim() }); } }); return results; } function extractDetails(html) { const details = []; const descriptionMatch = html.match(/
[\s\S]*?

([\s\S]*?)<\/p>/); let description = descriptionMatch ? descriptionMatch[1] : ''; const aliasesMatch = html.match(/

/); let aliases = aliasesMatch ? aliasesMatch[1] : ''; const airdateMatch = html.match(/