From 3e84da3dd100b34de5588cb3ef21823173481aa7 Mon Sep 17 00:00:00 2001 From: Kian <156937383+kian-mcchesney@users.noreply.github.com> Date: Sat, 20 Dec 2025 09:24:02 -0500 Subject: [PATCH] first commit --- js/ava_test_.js | 24 +++++++++++++ jstest.php | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 js/ava_test_.js create mode 100644 jstest.php diff --git a/js/ava_test_.js b/js/ava_test_.js new file mode 100644 index 0000000..3a610b3 --- /dev/null +++ b/js/ava_test_.js @@ -0,0 +1,24 @@ +function popup(){ + + +alert('hello there this is a test popup'); +console.log("hellooooo"); + +} + + +function replace_text(){ + + var x= document.getElementById("ub-tabbed-content-f5da2756-8434-41cd-aa83-ec95a71a9c26-panel-0"); + x.innerHTML=js_variable; + +} + +document.addEventListener("DOMContentLoaded", function () { + popup(); + + replace_text(); +}); + + + diff --git a/jstest.php b/jstest.php new file mode 100644 index 0000000..70f5551 --- /dev/null +++ b/jstest.php @@ -0,0 +1,89 @@ +(.*?)<\/div>\s*<\/div>/s', $html, $match); + + // if (!isset($match[0])) return $html; + + $book_block = $match[0]; + + $cover = extract_attr($book_block, '/]*src="([^"]+)"/'); + $title = extract_text($book_block, '/
\s*

(.*?)<\/h1>/'); + $author = extract_text($book_block, '/

(.*?)<\/p>/'); + $publisher = extract_text($book_block, '/

(.*?)<\/p>/'); + $imprint = extract_text($book_block, '/

(.*?)<\/p>/'); + $series = extract_text($book_block, '/

(.*?)<\/p>/'); + $isbn13 = extract_text($book_block, '/

(.*?)<\/p>/'); + $price = extract_text($book_block, '/

(.*?)<\/p>/'); + $format = extract_text($book_block, '/

(.*?)<\/p>/'); + $pubdate = extract_text($book_block, '/

(.*?)<\/p>/'); + $pages = extract_text($book_block, '/

(.*?)<\/p>/'); + $summary = extract_html($book_block, '/

(.*?)<\/div>/s'); + $description= extract_html($book_block, '/
(.*?)<\/div>/s'); + $reviews = extract_html($book_block, '/
(.*?)<\/div>/s'); + + + + + + + + return str_replace($book_block, $new_block, $html); +} + +function extract_text($html, $pattern) { + preg_match($pattern, $html, $m); + return $m[1] ?? ''; +} + +function extract_attr($html, $pattern) { + preg_match($pattern, $html, $m); + return $m[1] ?? ''; +} + +function extract_html($html, $pattern) { + preg_match($pattern, $html, $m); + return $m[1] ?? ''; +} + + +?> + + +