<?php
header
('Access-Control-Allow-Origin: *');

$src 'https://www.goodreads.com/review/custom_widget/2268122.Reading?cover_position=middle&cover_size=medium&num_books=5&order=d&shelf=currently-reading&show_author=1&show_cover=1&show_rating=0&show_review=0&show_tags=0&show_title=1&sort=date_added&widget_bg_color=FFFFFF&widget_bg_transparent=&widget_border_width=1&widget_id=1494711042&widget_text_color=000000&widget_title_size=medium&widget_width=thin';
$contents file_get_contents($src);

$start strpos($contents"var widget_code = '  ") + strlen("var widget_code = '  ");
$end strpos($contents"var widget_div") - $start 4;

$html substr($contents$start$end);
$stripped str_replace('\/''/'str_replace('\n'''str_replace('\"''"'$html)));
echo 
$stripped;
exit;

$doc = new DOMDocument();
$doc->loadHTML(str_replace('\n'''str_replace('\"''"'$html)));
#echo str_replace('\"', '"', $html);
echo $doc->saveHTML();
?>